diff --git a/docker-compose.yml b/docker-compose.yml index 7db3831e..896fe784 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,6 +62,23 @@ services: networks: - dtm-network + migrations: + build: + context: . + dockerfile: src/backend/Dockerfile + container_name: dtm_migrations + volumes: + - ./src/backend:/project/src/backend + depends_on: + - web + - db + env_file: + - .env + networks: + - dtm-network + entrypoint: ["pdm", "run", "alembic", "upgrade", "head"] + restart: "no" + networks: dtm-network: name: dtm-network diff --git a/src/backend/Dockerfile b/src/backend/Dockerfile index 114a6907..1db3b8ad 100644 --- a/src/backend/Dockerfile +++ b/src/backend/Dockerfile @@ -63,6 +63,9 @@ WORKDIR /project/src/backend/ # Set environment PATH ENV PATH="/project/.venv/bin:$PATH" +# Install PDM in runtime stage +RUN pip install -U pdm + # Copy the source files to the final image COPY src /project/src diff --git a/src/backend/app/main.py b/src/backend/app/main.py index 4653978b..941bea2d 100644 --- a/src/backend/app/main.py +++ b/src/backend/app/main.py @@ -73,8 +73,6 @@ def get_application() -> FastAPI: # Set custom logger _app.logger = get_logger() - print("cors = ", settings.EXTRA_CORS_ORIGINS) - _app.add_middleware( CORSMiddleware, allow_origins=settings.EXTRA_CORS_ORIGINS,