Skip to content

Commit 5d8f864

Browse files
authored
Merge pull request #56 from slaclab/zdomke/docker-entrypoint
DEV: Docker Entrypoint for Alembic Upgrade
2 parents 2ea66e8 + 122cebe commit 5d8f864

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
@@ -16,5 +16,7 @@ COPY . .
1616
# Install Python dependencies
1717
RUN pip install --no-cache-dir -e .
1818

19-
# Run with hot reload
19+
# Run migrations then start the application
20+
COPY docker/entrypoint.sh /entrypoint.sh
21+
ENTRYPOINT ["/entrypoint.sh"]
2022
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)