Skip to content

Commit

Permalink
make migration optional
Browse files Browse the repository at this point in the history
  • Loading branch information
hbruch committed Oct 30, 2023
1 parent 0f7149b commit 24ac08c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM python:3.11
LABEL maintainer="Holger Bruch <[email protected]>"

ENV RUN_MIGRATION=false

RUN apt-get install
RUN apt-get update && apt-get install -y \
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ services:
ports:
- 8000:8000
env_file: .env
environment:
- RUN_MIGRATION=1
scraper:
build:
context: .
Expand Down
9 changes: 6 additions & 3 deletions entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# init the main database
cd /app/web
./manage.py migrate
cd web

# Run migration only if explicitly set via ENV
if [ "$RUN_MIGRATION" != "false" ]; then
./manage.py migrate
fi

# don't create an admin interface per default
#./manage.py createsuperuser
Expand Down

0 comments on commit 24ac08c

Please sign in to comment.