Content management service (Spring Boot 3 / Java 21) with JWT auth, backed by PostgreSQL.
- Docker & Docker Compose
- (For local, non-Docker runs) JDK 21 and a local PostgreSQL instance
Active profile is controlled by spring.profiles.active in application.yml (defaults to local). Profile-specific files:
application-local.yml— local dev, expects Postgres onlocalhost:54322application-dev.yml— dev environment, expects Postgres onlocalhost:5432
Key env vars used by the container (see docker-compose.yml):
| Variable | Purpose |
|---|---|
SERVER_PORT |
HTTP port (default 30033) |
SPRING_UPLOAD_SERVER_PATH |
Directory for uploaded images |
SPRING_DATASOURCE_URL / _USERNAME / _PASSWORD |
Postgres connection |
The app and database run as separate Compose projects (docker-compose.yml at the repo root, postgres/docker-compose.yml) that communicate over a shared external-style bridge network named cf-cms-service. Neither file marks it external, so Compose creates it automatically the first time either project is brought up — whichever you start first wins, the second just attaches to the existing network.
- Start the database:
cd postgres docker compose up -d - Start the API (from the repo root):
docker compose up -d --build
- Check status / logs:
docker compose ps docker compose logs -f content-management-service
The API listens on 30033 and exposes:
- Health check:
/actuator/health - Swagger UI:
/swagger-ui.html - OpenAPI docs:
/v3/api-docs
Uploaded images are bind-mounted from ./upload/images on the host into the container.
If the shared network ever gets out of sync (e.g. one project's containers can't resolve postgres), remove it and let Compose recreate it:
docker compose down
docker network rm cf-cms-serviceThen bring both projects back up as in step 1–2.
Jenkinsfile defines a pipeline that SSHes into the target server, pulls the selected branch, and runs:
docker compose -f docker-compose.yml build --no-cache
docker compose -f docker-compose.yml up -dIt does not manage postgres/docker-compose.yml — the database is expected to already be running on the target server.
-
- Login -> Username + Password | Google | Facebook | Github
- Save to Local Storage
- Access Token -> 5 Minute Expired
- Refresh Token -> 90 day
- Call other call API with Access Token => JWT (Json Web Token)
- Access Token Expired
- Renew Access Token
- Auto Logout