Skip to content

Commit

Permalink
feat: compoes file updated for alembic migration
Browse files Browse the repository at this point in the history
  • Loading branch information
nrjadkry committed Jun 17, 2024
1 parent 5e51975 commit 2db9a30
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions src/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions src/backend/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2db9a30

Please sign in to comment.