diff --git a/Dockerfile b/Dockerfile index 49be1d4..4dd3d3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 [] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..28e6098 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e + +echo "Running database migrations..." +flask db upgrade + +echo "Starting Flask app..." +python app.py \ No newline at end of file