-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (34 loc) · 949 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
34
35
FROM eclipse-temurin:17-jdk-jammy as builder
WORKDIR /opt/app
ARG REDIS_HOST
ARG REDIS_PORT
ARG DATASOURCE_URL
ARG DATASOURCE_USER
ARG DATASOURCE_PASSWORD
ENV REDIS_HOST=${REDIS_HOST} \
REDIS_PORT=${REDIS_PORT} \
DATASOURCE_URL=${DATASOURCE_URL} \
DATASOURCE_USER=${DATASOURCE_USER} \
DATASOURCE_PASSWORD=${DATASOURCE_PASSWORD}
RUN echo $DATASOURCE_URL
COPY .mvn/ .mvn
COPY mvnw pom.xml ./
RUN chmod +x mvnw
RUN ./mvnw dependency:go-offline
COPY ./src ./src
RUN ./mvnw clean install
FROM eclipse-temurin:17-jre-jammy
WORKDIR /opt/app
ARG REDIS_HOST
ARG REDIS_PORT
ARG DATASOURCE_URL
ARG DATASOURCE_USER
ARG DATASOURCE_PASSWORD
ENV REDIS_HOST=${REDIS_HOST} \
REDIS_PORT=${REDIS_PORT} \
DATASOURCE_URL=${DATASOURCE_URL} \
DATASOURCE_USER=${DATASOURCE_USER} \
DATASOURCE_PASSWORD=${DATASOURCE_PASSWORD}
EXPOSE 8080
COPY --from=builder /opt/app/target/*.jar /opt/app/*.jar
ENTRYPOINT ["java", "-jar", "/opt/app/*.jar" ]