-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (26 loc) · 795 Bytes
/
Dockerfile
File metadata and controls
34 lines (26 loc) · 795 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
30
31
32
33
34
# Build stage
FROM gradle:jdk21 AS build
WORKDIR /home/app
COPY ./src /home/app/src
COPY build.gradle /home/app
COPY settings.gradle /home/app
COPY deploy.sh /home/app
# Set build arguments
ARG POSTGRES_HOST
ARG POSTGRES_PORT
ARG POSTGRES_DATABASE
ARG POSTGRES_USERNAME
ARG POSTGRES_PASSWORD
# Set environment variables for the build process
ENV POSTGRES_HOST $POSTGRES_HOST
ENV POSTGRES_PORT $POSTGRES_PORT
ENV POSTGRES_DATABASE $POSTGRES_DATABASE
ENV POSTGRES_USERNAME $POSTGRES_USERNAME
ENV POSTGRES_PASSWORD $POSTGRES_PASSWORD
# Build
RUN gradle clean build --no-daemon
# Package stage
FROM openjdk:21
COPY --from=build /home/app/build/libs/platform-training-1.0.0.jar /usr/local/lib/platform-training.jar
EXPOSE 8082
ENTRYPOINT ["java","-jar","/usr/local/lib/platform-training.jar"]