-
Notifications
You must be signed in to change notification settings - Fork 0
Docker and Deployment
Frody edited this page Sep 4, 2026
·
1 revision
AuthForge includes production-ready Docker containers and Docker Compose definitions for both the Spring Boot backend and the client dashboard.
The root docker-compose.yml provisions:
-
postgres: PostgreSQL 16 database with persistent volume. -
backend: Multi-stage built Spring Boot 3 app running on Eclipse Temurin 21 JRE. -
frontend: Nginx web server serving the static UI dashboard. -
mailhog: Local SMTP relay and webmail client for test verification.
docker-compose up -d --builddocker-compose down -vThe backend utilizes an optimized multi-stage build:
- Build stage: Compiles source code with Maven caching layer.
- Runtime stage: Strips build tools, runs as a non-root unprivileged container user on Alpine Linux / distroless base image for minimal attack surface.
# Multi-stage production execution
FROM eclipse-temurin:21-jre-alpine
WORKDIR /app
COPY --from=builder /workspace/target/authforge-*.jar app.jar
EXPOSE 8080
ENTRYPOINT ["java", "-jar", "app.jar"]-
Change Default Secrets: Ensure
JWT_SECRET,DB_PASSWORD, and OAuth2 secrets are injected securely via container environment variables or Kubernetes secrets. -
HTTPS / TLS Termination: Terminate SSL at your reverse proxy (Nginx, Traefik, AWS ALB) and set
server.forward-headers-strategy=native. -
Database Migration: In production environments, configure Flyway or Liquibase by setting
spring.jpa.hibernate.ddl-auto=validate.
AuthForge • Production Authentication & Authorization Starter Kit • GitHub