diff --git a/Dockerfile b/Dockerfile index 2b120ea..0a19343 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,8 @@ RUN apt-get update --yes --quiet && apt-get install --yes --quiet --no-install-r COPY requirements.txt / RUN pip install -r /requirements.txt +WORKDIR /app + # Build the production image, with the application server FROM base as production @@ -29,13 +31,6 @@ EXPOSE 80 # Install the application server. RUN pip install "gunicorn>=20.1.0,<20.2.0" -# Runtime command that executes when "docker run" is called, it does the -# following: -# 1. Migrate the database. -# 2. Start the application server. -# WARNING: -# Migrating database at the same time as starting the server IS NOT THE BEST -# PRACTICE. The database should be migrated manually or using the release -# phase facilities of your hosting platform. This is used only so the -# Wagtail instance can be started with a simple "docker run" command. -# CMD set -xe; python manage.py migrate --noinput; gunicorn ov_wag.wsgi:application --reload +COPY . . + +ENTRYPOINT /app/docker_entrypoints/deploy.sh diff --git a/docker-compose.yml b/docker-compose.yml index ca694d1..29ef777 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,6 @@ services: image: ov volumes: - ./:/app/ - working_dir: /app entrypoint: /app/docker_entrypoints/dev.sh deploy: restart_policy: @@ -23,7 +22,6 @@ services: image: ov-tests volumes: - ./:/app/ - working_dir: /app entrypoint: /app/docker_entrypoints/test.sh environment: - OV_DB_ENGINE=django.db.backends.sqlite3 diff --git a/docker_entrypoints/deploy.sh b/docker_entrypoints/deploy.sh new file mode 100755 index 0000000..dbc9731 --- /dev/null +++ b/docker_entrypoints/deploy.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +gunicorn ov_wag.wsgi:application --reload