-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
44 lines (33 loc) · 925 Bytes
/
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
#
# Build stage
#
FROM maven:3.6.3-jdk-8-slim AS build
ARG BASE_URL
ENV BASE_URL=$BASE_URL
ARG MAIL_USERNAME
ENV MAIL_USERNAME=$MAIL_USERNAME
ARG MAIL_PASSWORD
ENV MAIL_PASSWORD=$MAIL_PASSWORD
ARG DATASOURCE_POSTGRES_URL
ENV DATASOURCE_POSTGRES_URL=$DATASOURCE_POSTGRES_URL
ARG POSTGRES_USERNAME
ENV POSTGRES_USERNAME=$POSTGRES_USERNAME
ARG POSTGRES_PASSWORD
ENV POSTGRES_PASSWORD=$POSTGRES_PASSWORD
ARG JWT_SECRET
ENV JWT_SECRET=$JWT_SECRET
ARG CLOUDINARY_CLOUD_NAME
ENV CLOUDINARY_CLOUD_NAME=$CLOUDINARY_CLOUD_NAME
ARG CLOUDINARY_API_KEY
ENV CLOUDINARY_API_KEY=$CLOUDINARY_API_KEY
ARG CLOUDINARY_API_SECRET
ENV CLOUDINARY_API_SECRET=$CLOUDINARY_API_SECRET
COPY src /home/app/src
COPY pom.xml /home/app
RUN mvn -f /home/app/pom.xml clean package
#
# Package stage
#
FROM openjdk:8-jre-slim
COPY --from=build /home/app/target/*.jar /usr/local/lib/backend.jar
ENTRYPOINT ["java","-jar","/usr/local/lib/backend.jar"]