mirror of
https://github.com/StefBuwalda/WebTech.git
synced 2025-10-30 11:19:58 +00:00
Docker start stuff
This commit is contained in:
@@ -21,5 +21,9 @@ RUN pip install -r requirements.txt
|
|||||||
# Copy project files
|
# Copy project files
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
COPY docker-entrypoint.sh /entrypoint.sh
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
||||||
|
|
||||||
# Specify default command
|
# Specify default command
|
||||||
CMD ["python", "app.py"]
|
CMD ["python", "app.py"]
|
||||||
|
|||||||
11
entrypoint.sh
Normal file
11
entrypoint.sh
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Wait for DB to be ready (optional step)
|
||||||
|
# ./wait-for-it.sh db:5432 --timeout=30 -- echo "DB is up"
|
||||||
|
|
||||||
|
# Only run flask db init if migrations folder doesn't exist
|
||||||
|
if [ ! -d "migrations" ]; then
|
||||||
|
flask db init
|
||||||
|
fi
|
||||||
|
|
||||||
|
flask db migrate -m "Autogenerated migration"
|
||||||
|
flask db upgrade
|
||||||
Reference in New Issue
Block a user