mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-25 09:05:50 +00:00
docker compose config (now 100% more postgres compatible)
This commit is contained in:
parent
ba1fbbf0e5
commit
fe7cc235b6
2 changed files with 6 additions and 12 deletions
|
@ -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}"]
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue