Make backend choosable in docker-compose

This commit is contained in:
Marcel Schwarz 2020-05-15 17:40:55 +02:00
parent 8b2e26042c
commit 41756f67b4
3 changed files with 4 additions and 1 deletions

View File

@ -7,4 +7,5 @@ FROM openjdk:11-jre-slim
WORKDIR /root WORKDIR /root
COPY --from=build /root/build/libs/*.jar app.jar COPY --from=build /root/build/libs/*.jar app.jar
EXPOSE 5000 EXPOSE 5000
ENV PROFILE=prod
ENTRYPOINT ["java", "-jar", "app.jar"] ENTRYPOINT ["java", "-jar", "app.jar"]

View File

@ -2,4 +2,4 @@ server.port=5000
spring.datasource.hikari.initialization-fail-timeout=0 spring.datasource.hikari.initialization-fail-timeout=0
spring.datasource.hikari.max-lifetime=300000 spring.datasource.hikari.max-lifetime=300000
spring.jpa.show-sql=true spring.jpa.show-sql=true
spring.profiles.active=prod spring.profiles.active=${PROFILE:dev}

View File

@ -17,6 +17,8 @@ services:
context: ./backend context: ./backend
ports: ports:
- "5000:5000" - "5000:5000"
environment:
PROFILE: prod
depends_on: depends_on:
- db - db