This project uses Docker to containerize both the frontend and backend, enabling consistent builds and simplified deployment. Each service is defined with a multi-stage Dockerfile to optimize image size and build performance.
docker/backend.dockerfile
)The backend is a Spring Boot application built with Gradle and JDK 17. Its Dockerfile is split into two stages:
gradle:8.3-jdk17
):
bootJar
, skipping tests for speed.eclipse-temurin:17-jre
):
.jar
from the previous stage.ENV SPRING_PROFILES_ACTIVE=docker
for environment flexibility.8080
and runs the app via java -jar
.docker/frontend.dockerfile
)The frontend is a Vite-based React application served by Nginx. Its Dockerfile also uses two stages:
node:22-alpine
):
yarn build
to produce static assets.nginx:alpine
):
docker/nginx.conf
)./usr/share/nginx/html
.80
and starts Nginx in the foreground.docker/nginx.conf
)The custom Nginx config serves the frontend and proxies API calls to the backend:
try_files
to support client-side routing via index.html
.dist/
directory./api/
to the backend container (http://backend:8080/api/
).