ph4 #38

Merged
mo merged 5 commits from ph4 into prod 2025-06-01 19:19:21 +02:00

5 Commits

Author SHA1 Message Date
mohamad
a059768d8a Refactor: Simplify docker-compose configuration by removing unused services and optimizing backend settings
All checks were successful
Deploy to Production, build images and push to Gitea Registry / build_and_push (pull_request) Successful in 1m20s
This commit cleans up the `docker-compose.prod.yml` file by removing the database, Redis, and frontend service configurations, which were deemed unnecessary. The backend service configuration has been streamlined, including the update of the `VITE_API_URL` environment variable. This refactor aims to enhance clarity and maintainability of the Docker setup.
2025-06-01 19:18:42 +02:00
whtvrboo
09c3160fbb
Merge pull request #10 from whtvrboo/fix/docker-migrations
Fix(alembic): Resolve TypeError in migration script and remove redund…
2025-06-01 19:17:07 +02:00
google-labs-jules[bot]
287155a783 Fix(alembic): Resolve TypeError in migration script and remove redundant migration call
This commit addresses two issues:
1. A `TypeError` during Alembic migrations (`upgrade() takes 0 positional
   arguments but 1 was given`). This was caused by the `upgrade` and
   `downgrade` functions in the initial migration script not accepting
   any arguments, while the custom migration runner in `migrations.py`
   was passing a context argument.
   - Modified `be/alembic/versions/0001_initial_schema.py` to ensure
     `upgrade` and `downgrade` functions accept a `context` argument.

2. Redundant execution of migrations. Migrations were being triggered
   both by the `entrypoint.sh` script and within the FastAPI application's
   startup event in `app/main.py`.
   - Commented out the `await run_migrations()` call in `app/main.py`
     to ensure migrations are only handled by the `entrypoint.sh` script.

These changes should ensure that database migrations run correctly and only
once when the backend container starts.
2025-06-01 17:16:41 +00:00
whtvrboo
c50395ae86
Merge pull request #9 from whtvrboo/fix/docker-migrations
Fix(docker): Run Alembic migrations on container startup
2025-06-01 19:10:53 +02:00
google-labs-jules[bot]
4540ad359e Fix(docker): Run Alembic migrations on container startup
This commit introduces changes to ensure that Alembic database migrations
are automatically applied when the backend Docker container starts.

Key changes:
- Added `be/entrypoint.sh`: This script first runs `alembic upgrade head`
  to apply any pending migrations and then executes the main container
  command (e.g., starting Uvicorn).
- Modified `be/Dockerfile`:
    - The `entrypoint.sh` script is copied into the image and made executable.
    - The Docker `ENTRYPOINT` is set to this script, ensuring migrations
      run before the application starts.
- Updated `docker-compose.yml`:
    - The `DATABASE_URL` for the `backend` service has been set to the
      Neon database URL you provided.
- Verified `be/alembic/env.py`: Confirmed that it correctly sources the
  `DATABASE_URL` from environment variables for Alembic to use.

These changes address the issue where migrations were not being run,
preventing the application from starting correctly.
2025-06-01 17:10:40 +00:00