Add Docker Compose setup with PostgreSQL 16 and Spring Boot app
Multi-stage Dockerfile for the backend (build + runtime). Compose defines db (postgres:16-alpine with healthcheck) and app services. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
13
backend/Dockerfile
Normal file
13
backend/Dockerfile
Normal file
@@ -0,0 +1,13 @@
|
||||
FROM eclipse-temurin:21-jdk-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY mvnw pom.xml ./
|
||||
COPY .mvn .mvn
|
||||
RUN ./mvnw dependency:go-offline -B
|
||||
COPY src src
|
||||
RUN ./mvnw package -DskipTests -B
|
||||
|
||||
FROM eclipse-temurin:21-jre-alpine
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/target/*.jar app.jar
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["java", "-jar", "app.jar"]
|
||||
Reference in New Issue
Block a user