This commit is contained in:
yahaozhang
2025-07-20 16:55:23 +08:00
parent 36c5d7f760
commit 8962943123
18 changed files with 1231 additions and 23 deletions

24
Dockerfile Normal file
View File

@@ -0,0 +1,24 @@
# Use official OpenJDK 17 runtime as base image
FROM openjdk:17-jdk-slim
# Set working directory
WORKDIR /app
# Copy Maven wrapper and pom.xml first for better layer caching
COPY .mvn/ .mvn/
COPY mvnw pom.xml ./
# Download dependencies (this layer will be cached unless pom.xml changes)
RUN ./mvnw dependency:go-offline -B
# Copy source code
COPY src ./src
# Build the application
RUN ./mvnw clean package -DskipTests
# Expose port 8080
EXPOSE 8080
# Run the jar file
CMD ["java", "-jar", "target/chat-0.0.1-SNAPSHOT.jar"]