29 lines
689 B
YAML
29 lines
689 B
YAML
version: "3.7"
|
|
|
|
services:
|
|
db:
|
|
image: postgres
|
|
volumes:
|
|
- ./data/db:/var/lib/postgresql/data
|
|
environment:
|
|
- POSTGRES_DB=djangoApp
|
|
- POSTGRES_USER=django
|
|
- POSTGRES_PASSWORD=password
|
|
web:
|
|
build:
|
|
context: ./
|
|
target: final
|
|
|
|
command: >
|
|
sh -c "python3 djangobase/manage.py migrate &&
|
|
gunicorn djangobase.Settings.wsgi"
|
|
environment:
|
|
DATABASE_URL: postgres://django:password@db:5432/djangoApp
|
|
SECRET_KEY: Changeme #Very important that you change this.
|
|
#Generate a new one with: python -c "import secrets; print(secrets.token_urlsafe())"
|
|
|
|
ports:
|
|
- "8000:8000"
|
|
depends_on:
|
|
- db
|