Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile production #41

Merged
merged 3 commits into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ services:
image: ov
volumes:
- ./:/app/
working_dir: /app
entrypoint: /app/docker_entrypoints/dev.sh
deploy:
restart_policy:
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions docker_entrypoints/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

gunicorn ov_wag.wsgi:application --reload