forked from Step3-kakao-tech-campus/Team12_BE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (19 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
# Stage 1: Build the application
FROM gradle:8.0-jdk17 AS build
# Set the working directory in the container
WORKDIR /workspace/Team12_BE
# Copy local code to the container
COPY . .
# If you're behind a proxy, set the proxy settings
RUN echo "systemProp.http.proxyHost=krmp-proxy.9rum.cc\nsystemProp.http.proxyPort=3128\nsystemProp.https.proxyHost=krmp-proxy.9rum.cc\nsystemProp.https.proxyPort=3128" > /root/.gradle/gradle.properties
RUN gradle wrapper
# Build the application
RUN ./gradlew build -x test
# Stage 2: Run the application
FROM krmp-d2hub-idock.9rum.cc/goorm/eclipse-temurin:17-jre
# Copy the built jar file from the build stage into the current stage
COPY --from=build /workspace/Team12_BE/build/libs/Team12_BE-0.0.1-SNAPSHOT.jar .
# Set environment variables
ENV DATABASE_URL=jdbc:mysql://pickup-mysql-dev/pickup
# Start the application
CMD ["java", "-jar", "-Dspring.profiles.active=dev", "Team12_BE-0.0.1-SNAPSHOT.jar"]