mirror of
https://github.com/StefBuwalda/cal_counter.git
synced 2025-10-30 03:10:00 +00:00
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:
@@ -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
8
entrypoint.sh
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
echo "Running database migrations..."
|
||||
flask db upgrade
|
||||
|
||||
echo "Starting Flask app..."
|
||||
python app.py
|
||||
Reference in New Issue
Block a user