forked from ibwgr/todomvc-java-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (20 loc) · 746 Bytes
/
Dockerfile
File metadata and controls
29 lines (20 loc) · 746 Bytes
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
# Base image, "build" is the alias of this first step
FROM maven:3.6.3-jdk-11 as build
# Set dir inside container
WORKDIR /app
# Copy all files from location of Dockerfile into current directory (/app) in container
COPY . .
# Build maven project, creates jar file in "target" dir
RUN mvn clean package
# Base image
FROM openjdk:11-jre
# Set dir inside the container
WORKDIR /app
# Copy built jar file from previous "build" step to app dir
COPY --from=build /app/target/server-*.jar /app/
# Make port accessible from outside of the container
EXPOSE 4567
# Allow to override default JDBCI_URI with container start
ENV JDBC_URI=""
# Start process inside the container
CMD ["java", "-jar", "./server-1.0-SNAPSHOT-jar-with-dependencies.jar"]