version: '3.6' services: cms: image: androiddrew/datasketch:latest deploy: replicas: 1 restart_policy: condition: on-failure ports: - 8000:8000 secrets: - datasketch_key - pg_passwd_datasketch environment: - DJANGO_SETTINGS_MODULE=cms.settings.production - DB_HOST=db - DB_USER=datasketch volumes: - datasketch-media-vol:/code/media depends_on: - db networks: - datasketch_net db: image: postgres:10.5-alpine deploy: replicas: 1 restart_policy: condition: on-failure # Docker secrets for postgres are referenced by /run/secrets/ secrets: - pg_passwd_datasketch environment: - POSTGRES_USER=datasketch - POSTGRES_PASSWORD_FILE=/run/secrets/pg_passwd_datasketch - POSTGRES_DB=datasketch expose: - 5432 volumes: - datasketch-db-vol:/var/lib/postgresql/data networks: - datasketch_net networks: datasketch_net: driver: overlay volumes: datasketch-db-vol: driver: local driver_opts: type: nfs o: addr=nas1.androiddrew.com,rw device: ":/volume1/expanse/datasketch_pg_data" datasketch-media-vol: driver: local driver_opts: type: nfs o: addr=nas1.androiddrew.com,rw device: ":/volume1/expanse/datasketch_media" secrets: pg_passwd_datasketch: external: true datasketch_key: external: true