chore(deploy): dockerize the frontend and backend applications - #30
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dockerizes both the frontend and backend so the full stack (Postgres, backend, frontend) can be run with a single
docker compose up, and updates project documentation to reflect the new workflow.Type of Change
Related Issue
Closes #11
Changes
apps/backend/Dockerfile: multi-stage build usingnest build(webpack) to bundle all dependencies into a singledist/main.js, so the runtime image ships nonode_modulesand runs as the unprivilegednodeuserapps/frontend/Dockerfile: builds the Angular app and serves the staticbrowser/output via nginxapps/frontend/nginx.conf.template, rendered fromBACKEND_HOST/BACKEND_PORTat container start, proxying/api/*to thebackendcontainerdocker-compose.ymlwiringdb(Postgres 16, bound to127.0.0.1only),backend, andfrontendservices with healthchecks and startup ordering (depends_on: condition: service_healthy).env.examplefor Docker Compose config (DB_USERNAME,DB_PASSWORD,DB_DATABASE,JWT_SECRET,BCRYPT_SALT_ROUNDS,ALLOWED_ORIGIN, and host port overridesDB_PORT/BACKEND_PORT/FRONTEND_PORT) — separate fromapps/backend/.envused by the native workflow.dockerignoreapps/frontend/package.jsonandapps/frontend/src/environments/environment.production.tsfor the containerized buildCLAUDE.md,README.md,docs/architecture/high-level-design.md, anddocs/srs.mdto document the Docker workflow alongside the existing native workflowCHANGELOG.mdunder[Unreleased]with the new infrastructure additionsTesting
npm run lintpasses with no errorscd apps/backend && npm test)Manual verification:
docker compose up -d --buildbrings updb,backend,frontendin order (backend waits on Postgres healthcheck, frontend waits on backend healthcheck); registered/logged in throughhttp://localhost:4200and confirmed the Kanban board loads with/api/*correctly proxied to the backend container.Screenshots
N/A — no UI change.
Notes for Reviewer
DB_USERNAME/DB_PASSWORDin.envonly take effect the first time thepgdatavolume is created; changing them later requiresdocker compose down -v, which drops the volume — called out in both.env.exampleanddocker-compose.yml.127.0.0.1only and is not reachable from outside the host.npm run start:backend/start:frontendagainstapps/backend/.env) is untouched.