Installation with Docker
Prerequisites
Setup steps
1. Prepare the Working Directory
version: '3'
volumes:
shared_static: {}
postgresql_data: {}
services:
nginx:
image: nginx:latest
ports:
- "9999:9999"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
- shared_static:/static/:ro
depends_on:
- web
web:
image: icij/prophecies:0.5.9
environment:
- ALLOWED_HOSTS=0.0.0.0,localhost,web
- CSRF_TRUSTED_ORIGINS=http://localhost:9999
- DATABASE_URL=postgres://postgres:postgres@db/prophecies
- DEBUG=false
- DJANGO_SETTINGS_MODULE=prophecies.settings.production
- DJANGO_ADMIN_LOGIN=true
- PROPHECIES_APP_LOGIN_URL=/admin/login/?next=/
- PORT=8008
- WAIT_HOSTS_TIMEOUT=60
- WAIT_HOSTS=db:5432
volumes:
- shared_static:/code/prophecies/run/static
depends_on:
- db
- migration
- collectstatic
expose:
- "8008"
migration:
image: icij/prophecies:0.5.9
command: sh -c '/usr/bin/wait && poetry run python manage.py migrate --noinput'
environment:
- WAIT_HOSTS=db:5432
- WAIT_HOSTS_TIMEOUT=60
- DATABASE_URL=postgres://postgres:postgres@db/prophecies
depends_on:
- db
collectstatic:
image: icij/prophecies:0.5.9
command: poetry run python manage.py collectstatic --noinput
volumes:
- shared_static:/code/prophecies/run/static
db:
image: postgres:16
restart: always
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: prophecies
command: postgres -c shared_preload_libraries=pg_stat_statements -c 'pg_stat_statements.track=all'
volumes:
- postgresql_data:/var/lib/postgresql/data2. Configure NGINX
3. Starting Services
3. Database Migrations and Static Files
4. Create Admin User
5. Accessing the Application
Additional Notes
Last updated