Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ COPY . .
RUN pip install --no-cache-dir -e .

# Run migrations then start the application
# COPY docker/entrypoint.sh /entrypoint.sh
# ENTRYPOINT ["/entrypoint.sh"]
COPY docker/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
2 changes: 2 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ services:
container_name: squirrel-api
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
environment:
RUN_MIGRATIONS: "true" # Dev only - run migrations manually in prod

SQUIRREL_DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
SQUIRREL_REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379/0
SQUIRREL_DEBUG: "${SQUIRREL_DEBUG}"
Expand Down
4 changes: 3 additions & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
set -e

alembic upgrade head
if [ "${RUN_MIGRATIONS:-false}" = "true" ]; then
alembic upgrade head
fi

exec "$@"
Loading