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:
2026-04-01 20:51:54 +02:00
commit c11d5ff192
2 changed files with 49 additions and 0 deletions

13
backend/Dockerfile Normal file
View 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"]