Skip to content

Instantly share code, notes, and snippets.

@vovimayhem
Created April 4, 2018 20:51
Show Gist options
  • Save vovimayhem/c06338b3c8b4f2c0ec308c740d1cfcd4 to your computer and use it in GitHub Desktop.
Save vovimayhem/c06338b3c8b4f2c0ec308c740d1cfcd4 to your computer and use it in GitHub Desktop.
compose-example
version: "3.4"
volumes:
postgres-data:
services:
postgres:
image: postgres:10.3-alpine
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: 3x4mpl3
deploy:
placement:
constraints: [node.role == manager]
web:
image: vovimayhem/real-world-backend-django
ports:
- published: 5000
target: 8000
depends_on:
- postgres
environment:
DATABASE_URL: postgres://postgres:3x4mpl3@postgres:5432/demo_development
deploy:
replicas: 2
update_config:
parallelism: 2
restart_policy:
condition: on-failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment