mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-18 05:25:50 +00:00
Docker configuration
This commit is contained in:
parent
ffa967c94b
commit
186fde09ed
2 changed files with 35 additions and 9 deletions
17
Dockerfile
Normal file
17
Dockerfile
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
FROM maven:latest
|
||||||
|
|
||||||
|
# Set the workdir
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Copy the source to the container
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Build the project
|
||||||
|
RUN mvn package
|
||||||
|
|
||||||
|
# Make the jar executable
|
||||||
|
RUN sh -c 'touch target/spring-petclinic-*.jar'
|
||||||
|
|
||||||
|
#Start the project
|
||||||
|
ENV JAVA_OPTS=""
|
||||||
|
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar target/spring-petclinic-*.jar" ]
|
|
@ -1,4 +1,13 @@
|
||||||
mysql:
|
version: '2'
|
||||||
|
services:
|
||||||
|
pet-clinic:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "8080:8080"
|
||||||
|
links:
|
||||||
|
- mysql:mysql
|
||||||
|
command: java -jar ./target/*.jar
|
||||||
|
mysql:
|
||||||
image: mysql
|
image: mysql
|
||||||
ports:
|
ports:
|
||||||
- "3306:3306"
|
- "3306:3306"
|
||||||
|
|
Loading…
Reference in a new issue