Add entrypoint script for Docker container

Introduces entrypoint.sh to handle database migrations before starting the Flask app. Updates Dockerfile to use the new entrypoint script and ensures it is executable.
This commit is contained in:
2025-08-11 01:25:02 +02:00
parent 7f806e52dd
commit 135e226db8
2 changed files with 12 additions and 5 deletions

View File

@@ -2,10 +2,9 @@ FROM python:3.12-slim
# Everything will be done in /app (Not in the main OS Image)
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN pip install --no-cache-dir -r requirements.txt
RUN chmod +x /entrypoint.sh
CMD ["python", "app.py"]
ENTRYPOINT ["/entrypoint.sh"]
CMD []

8
entrypoint.sh Normal file
View File

@@ -0,0 +1,8 @@
#!/bin/sh
set -e
echo "Running database migrations..."
flask db upgrade
echo "Starting Flask app..."
python app.py