-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
34 lines (27 loc) · 1.17 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
FROM openjdk:11-jdk as build
WORKDIR /workspace/app
COPY gradlew .
COPY gradle gradle
COPY build.gradle .
COPY settings.gradle .
RUN ./gradlew dependencies
COPY src src
RUN ./gradlew build -x test
RUN mkdir -p build/dependency && (cd build/dependency; jar -xf ../libs/*.jar)
FROM openjdk:11
ENV SPRING_DATASOURCE_URL "DATABASE_URL"
ENV SPRING_DATASOURCE_USERNAME "root"
ENV SPRING_DATASOURCE_PASSWORD "password"
ENV SPRING_DATASOURCE_DIALECT "org.hibernate.spatial.dialect.postgis.PostgisDialect"
ENV FIREBASE_KEY_LOCATION "firebase"
ENV CORS_ORIGINS "http://localhost:8080"
VOLUME /tmp
ARG DEPENDENCY=/workspace/app/build/dependency
COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF
COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app
EXPOSE 8080
ENTRYPOINT ["java", "-Dorg.codevscovid19.threedprintingservice.security.firebase.key.location=${FIREBASE_KEY_LOCATION}",\
"-Dorg.codevscovid19.threedprintingservice.config.cors.origins=${CORS_ORIGINS}",\
"-Dspring.jpa.database-platform=${SPRING_DATASOURCE_DIALECT}",\
"-cp","app:app/lib/*","org.codevscovid19.threedprintingservice.Application"]