docker compose config (now 100% more postgres compatible)

This commit is contained in:
GasparAM 2023-04-11 15:51:55 +04:00
parent ba1fbbf0e5
commit fe7cc235b6
2 changed files with 6 additions and 12 deletions

View file

@ -16,9 +16,9 @@ COPY ./ ./
RUN ./mvnw clean ; ./mvnw package
FROM alpine:latest
ENV JAR=spring-petclinic-3.0.3.jar
ENV DB=
RUN apk --no-cache add openjdk17-jre-headless
WORKDIR /home
COPY --from=builder /tmp/target/spring-*.jar ./
EXPOSE 8080
CMD ["/bin/sh", "-c", "/usr/bin/java -jar /home/spring-*.jar"]
CMD ["/bin/sh", "-c", "/usr/bin/java -jar /home/spring-*.jar ${DB}"]

View file

@ -1,18 +1,12 @@
version: "2.2"
services:
mysql:
image: mysql:8.0
spring-petclinic:
build: ./
ports:
- "3306:3306"
- "8080:8080"
environment:
- MYSQL_ROOT_PASSWORD=
- MYSQL_ALLOW_EMPTY_PASSWORD=true
- MYSQL_USER=petclinic
- MYSQL_PASSWORD=petclinic
- MYSQL_DATABASE=petclinic
volumes:
- "./conf.d:/etc/mysql/conf.d:ro"
- DB="--spring.profiles.active=postgres"
postgres:
image: postgres:15.2
ports: