-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (22 loc) · 867 Bytes
/
Dockerfile
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
30
31
32
33
FROM maven:3.9.6-eclipse-temurin-21-alpine as builder
WORKDIR /app
COPY pom.xml .
COPY src ./src
RUN mvn clean package -DskipTests
# Path: Dockerfile
FROM openjdk:23-jdk-oracle
WORKDIR /app
COPY --from=builder app/target/cinemabookingsystem.jar .
EXPOSE 8080
# maybe you dont use docker compose and you want to pass the env variables
ARG SERVER_SERVLET_CONTEXT_PATH=/api/v1
ARG SPRING_DATA_MONGODB_URI=mongodb://localhost:27017/
ARG SPRING_DATA_MONGODB_DATABASE=cinemabookingsystem
ARG JWT_SECRET_KEY=mysecretkey
ARG JWT_EXPIRATION_TIME=86400000
ENV SERVER_SERVLET_CONTEXT_PATH=$SERVER_SERVLET_CONTEXT_PATH
ENV SPRING_DATA_MONGODB_URI=$SPRING_DATA_MONGODB_URI
ENV SPRING_DATA_MONGODB_DATABASE=$SPRING_DATA_MONGODB_DATABASE
ENV JWT_SECRET_KEY=$JWT_SECRET_KEY
ENV JWT_EXPIRATION_TIME=$JWT_EXPIRATION_TIME
CMD ["java", "-jar", "/app/cinemabookingsystem.jar"]