Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.4 KB

DEPLOY.md

File metadata and controls

38 lines (27 loc) · 1.4 KB

Setup the Production Server

The following describes how to run the server in production using Docker Compose.

Requirements

  • Git 1.8+
  • Docker 17.09+ (since we use --chown flag in the COPY directive)
  • Docker Compose

Gather Container Environment Variables

There are four configurations that must be set when running the container.

  • SECRET_KEY is used to provide cryptographic signing, refer to src/pycontw2016/settings/local.sample.env on how to generate secret key
  • MEDIA_ROOT specifies where media files (user-uploaded assets) are stored in the host. This will be mounted into the container.
  • DATABASE_URL specifies how to connect to the database (in the URL form e.g. postgres:https://username:password@host_or_ip:5432/database_name)
  • EMAIL_URL specifies how to connect to the mail server (e.g. smtp+tls:https://username:password@host_or_ip:25)
  • DSN_URL specify how to connect to Sentry error reporting service (e.g. https://[email protected]/project), please refer to Sentry's documentation on how to obtain Data Source Name
  • (optional) GTM_TRACK_ID
  • (optional) SLACK_WEBHOOK_URL

Write them in a .env file at the same directory that contains docker-compose.yml.

Run the Production Server

Run the production server container:

docker-compose start