Skip to content

Repair Docker Compose full-stack setup - #49

Merged
AlexKitipov merged 1 commit into
mainfrom
codex/repair-docker-compose-full-stack-setup
Jun 9, 2026
Merged

Repair Docker Compose full-stack setup#49
AlexKitipov merged 1 commit into
mainfrom
codex/repair-docker-compose-full-stack-setup

Conversation

@AlexKitipov

Copy link
Copy Markdown
Owner

Motivation

  • Make docker compose up bring up a coherent local stack including backend, frontend, Postgres, Redis and an optional Nginx proxy.
  • Ensure migrations run automatically before the API starts and use a sync PostgreSQL URL because the backend uses sync SQLAlchemy/psycopg2.
  • Avoid exposing database/cache ports by default to keep Compose runs production-like and document how to publish them when needed.

Description

  • Added a production-style frontend image with Dockerfile.frontend that builds the React app and serves the static bundle via Nginx and docker/frontend.conf.
  • Reworked docker-compose.yml to include postgres, redis, a one-shot migrate job that runs /app/scripts/migrate.sh, backend, frontend, and an optional nginx service under the proxy profile, and made the backend depend on the migrate job via service_completed_successfully.
  • Switched Compose and .env.example to a sync DB URL (postgresql://...) and set internal redis://redis:6379, removed default ports publishing for Postgres and Redis, and added published web ports (BACKEND_PORT, FRONTEND_PORT, NGINX_PORT).
  • Updated Dockerfile to set PYTHONUNBUFFERED/PYTHONDONTWRITEBYTECODE, add EXPOSE 8000, and note that Compose runs migrations via the migrate job; added .dockerignore; and replaced the README Docker section with a new Docker Compose Full-Stack Setup that documents usage and override guidance.

Testing

  • Ran npm run build in the frontend and the React production build completed successfully.
  • Ran python -m compileall app to verify Python modules compile successfully.
  • Loaded docker-compose.yml with a small Python script and asserted structure/behaviour (no ports on postgres/redis, backend depends on migrate, and DATABASE_URL starts with postgresql://), which passed.
  • Attempted docker compose config but it could not run in this environment because Docker is not installed (/bin/bash: line 1: docker: command not found).

Codex Task

@AlexKitipov
AlexKitipov merged commit cb41083 into main Jun 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant