diff --git a/Dockerfile b/Dockerfile index f62763f..d5df32e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,5 +16,6 @@ EXPOSE 8080 WORKDIR /app COPY ./manage.py ./ +COPY ./docker-entrypoint.sh ./ -ENTRYPOINT ["gunicorn", "-b", "0.0.0.0:8080", "--workers", "4", "--threads", "4", "geogame.wsgi:application"] +ENTRYPOINT ["bash", "/app/docker-entrypoint.sh"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..8faa840 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +# Collect static files +echo "Collect static files" +python manage.py collectstatic --noinput + +# Apply database migrations +echo "Apply database migrations" +python manage.py migrate + +# Start server +echo "Starting server" +gunicorn -b 0.0.0.0:8080 --workers 4 --threads 4 geogame.wsgi:application