forked from KSEB-4th-Project-3rd-Team/BE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (22 loc) · 758 Bytes
/
Dockerfile
File metadata and controls
30 lines (22 loc) · 758 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
# Use an official OpenJDK runtime as a parent image
FROM eclipse-temurin:17-jdk-jammy
# Set the working directory in the container
WORKDIR /app
# Copy the Gradle wrapper and build files
COPY gradlew .
COPY gradle ./gradle
COPY build.gradle .
COPY settings.gradle .
# Grant executable permissions to the Gradle wrapper
RUN chmod +x ./gradlew
# Copy the source code
COPY src ./src
# ✅ Copy the .env file into the image
COPY .env .env
# Build the application
RUN ./gradlew bootJar
# Expose the port the app runs on
EXPOSE 8080
# ✅ Specify the command to run on container startup
# export .env variables at runtime, then run the Spring Boot jar
CMD ["bash", "-c", "export $(cat .env | xargs) && java -jar build/libs/Smart_WMS_BE-0.0.1-SNAPSHOT.jar"]