-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
48 lines (32 loc) · 1.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM node:17-alpine as frontend-build
# TODO: disable this once fully migrated to latest packages
ENV NODE_OPTIONS=--openssl-legacy-provider
COPY frontend/ ./frontend
WORKDIR ./frontend
RUN npm i
RUN npm run build
FROM maven:3-openjdk-17 AS build
WORKDIR /app
COPY backend/pom.xml ./
RUN mvn verify --fail-never -U
COPY backend/ ./
# Copy frontend build to local resources classpath folder
ENV FRONTEND_PATH=/app/src/main/resources/frontend
COPY --from=frontend-build ./frontend/build $FRONTEND_PATH
RUN mvn -Dmaven.test.skip=true package
FROM wirebot/runtime:1.4.0 AS runtime
LABEL description="Wire Roman"
LABEL project="wire-bots:roman"
# update dependencies in the base image
RUN apt-get update && apt-get upgrade -y
# Copy backend
COPY --from=build /app/target/roman.jar /opt/roman/backend/
COPY backend/roman.yaml /etc/roman/
# create version file
ARG release_version=development
ENV RELEASE_FILE_PATH=/opt/roman/release.txt
RUN echo $release_version > /opt/roman/release.txt
# ENV APPENDER_TYPE=json-console
WORKDIR /opt/roman/backend/
EXPOSE 8080 8081 8082
ENTRYPOINT ["java", "-javaagent:/opt/wire/lib/prometheus-agent.jar=8082:/opt/wire/lib/metrics.yaml", "-jar", "roman.jar", "server", "/etc/roman/roman.yaml"]