Skip to content

Commit 681091f

Browse files
committed
ENH: Docker Entrypoint for Alembic Upgrade
1 parent ddc79b3 commit 681091f

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

docker/Dockerfile.dev

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ RUN pip install --no-cache-dir .
1717
# Copy application
1818
COPY . .
1919

20-
# Run with hot reload
20+
# Run migrations then start the application
21+
COPY docker/entrypoint.sh /entrypoint.sh
22+
ENTRYPOINT ["/entrypoint.sh"]
2123
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]

docker/entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -e
3+
4+
alembic upgrade head
5+
6+
exec "$@"

0 commit comments

Comments
 (0)