forked from GerardPaligot/Confily
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (23 loc) · 861 Bytes
/
Dockerfile
File metadata and controls
29 lines (23 loc) · 861 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
# Packing the application
FROM gradle:8.14-jdk21 AS cache
RUN mkdir -p /home/gradle/cache_home
ENV GRADLE_USER_HOME=/home/gradle/cache_home
COPY build.gradle.* gradle.properties /home/gradle/app/
COPY gradle /home/gradle/app/gradle
WORKDIR /home/gradle/app
RUN gradle build -i --stacktrace
FROM gradle:8.13-jdk21 AS build
COPY --from=cache /home/gradle/cache_home /home/gradle/.gradle
COPY --chown=gradle:gradle . /home/gradle/src
WORKDIR /home/gradle/src
RUN gradle :backend:shadowJar --no-daemon
FROM amazoncorretto:21 AS runtime
EXPOSE 8080
RUN mkdir /app
# Create directory for Google Cloud credentials
RUN mkdir -p /app/config
COPY --from=build /home/gradle/src/backend/build/libs/*-all.jar /app/application.jar
# Copy and setup entrypoint script
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
ENTRYPOINT ["/app/entrypoint.sh"]