Skip to content

Commit

Permalink
♻️ Simplify Docker Compose files and deployment (#153)
Browse files Browse the repository at this point in the history
* ♻️ Simplify Docker Compose files and deployment

* 🔧 Remove TRAEFIK_PUBLIC_NETWORK_IS_EXTERNAL from .env
  • Loading branch information
tiangolo authored Apr 19, 2020
1 parent 283bc7c commit 2afe415
Show file tree
Hide file tree
Showing 25 changed files with 250 additions and 325 deletions.
3 changes: 0 additions & 3 deletions {{cookiecutter.project_slug}}/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
COMPOSE_PATH_SEPARATOR=:
COMPOSE_FILE=docker-compose.shared.admin.yml:docker-compose.shared.base-images.yml:docker-compose.shared.depends.yml:docker-compose.shared.env.yml:docker-compose.dev.build.yml:docker-compose.dev.command.yml:docker-compose.dev.env.yml:docker-compose.dev.labels.yml:docker-compose.dev.networks.yml:docker-compose.dev.ports.yml:docker-compose.dev.volumes.yml

DOMAIN=localhost
# DOMAIN=local.dockertoolbox.tiangolo.com
# DOMAIN=localhost.tiangolo.com
Expand Down
15 changes: 0 additions & 15 deletions {{cookiecutter.project_slug}}/docker-compose.deploy.build.yml

This file was deleted.

11 changes: 0 additions & 11 deletions {{cookiecutter.project_slug}}/docker-compose.deploy.command.yml

This file was deleted.

This file was deleted.

57 changes: 0 additions & 57 deletions {{cookiecutter.project_slug}}/docker-compose.deploy.labels.yml

This file was deleted.

18 changes: 0 additions & 18 deletions {{cookiecutter.project_slug}}/docker-compose.deploy.networks.yml

This file was deleted.

This file was deleted.

19 changes: 0 additions & 19 deletions {{cookiecutter.project_slug}}/docker-compose.dev.build.yml

This file was deleted.

14 changes: 0 additions & 14 deletions {{cookiecutter.project_slug}}/docker-compose.dev.command.yml

This file was deleted.

11 changes: 0 additions & 11 deletions {{cookiecutter.project_slug}}/docker-compose.dev.env.yml

This file was deleted.

19 changes: 0 additions & 19 deletions {{cookiecutter.project_slug}}/docker-compose.dev.labels.yml

This file was deleted.

7 changes: 0 additions & 7 deletions {{cookiecutter.project_slug}}/docker-compose.dev.networks.yml

This file was deleted.

15 changes: 0 additions & 15 deletions {{cookiecutter.project_slug}}/docker-compose.dev.ports.yml

This file was deleted.

8 changes: 0 additions & 8 deletions {{cookiecutter.project_slug}}/docker-compose.dev.volumes.yml

This file was deleted.

76 changes: 76 additions & 0 deletions {{cookiecutter.project_slug}}/docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
version: "3.3"
services:

proxy:
ports:
- "80:80"
- "8090:8080"
command: --docker \
--docker.watch \
--docker.exposedbydefault=false \
--constraints=tag==${TRAEFIK_TAG} \
--logLevel=DEBUG \
--accessLog \
--web
labels:
- traefik.frontend.rule=Host:${DOMAIN}
- traefik.enable=true
- traefik.port=80

pgadmin:
ports:
- "5050:5050"

flower:
ports:
- "5555:5555"

backend:
ports:
- "8888:8888"
volumes:
- ./backend/app:/app
environment:
- JUPYTER=jupyter lab --ip=0.0.0.0 --allow-root --NotebookApp.custom_display_url=http://127.0.0.1:8888
- SERVER_HOST=http://${DOMAIN}
build:
context: ./backend
dockerfile: backend.dockerfile
args:
env: dev
# command: bash -c "while true; do sleep 1; done" # Infinite loop to keep container live doing nothing
command: /start-reload.sh
labels:
- traefik.frontend.rule=PathPrefix:/api,/docs,/redoc
- traefik.enable=true
- traefik.port=80
- traefik.tags=${TRAEFIK_TAG}

celeryworker:
volumes:
- ./backend/app:/app
environment:
- RUN=celery worker -A app.worker -l info -Q main-queue -c 1
- JUPYTER=jupyter lab --ip=0.0.0.0 --allow-root --NotebookApp.custom_display_url=http://127.0.0.1:8888
- SERVER_HOST=http://${DOMAIN}
build:
context: ./backend
dockerfile: celeryworker.dockerfile
args:
env: dev

frontend:
build:
context: ./frontend
args:
FRONTEND_ENV: dev
labels:
- traefik.frontend.rule=PathPrefix:/
- traefik.enable=true
- traefik.port=80
- traefik.tags=${TRAEFIK_TAG}

networks:
traefik-public:
# For local dev, don't expect an external Traefik network
external: false
21 changes: 0 additions & 21 deletions {{cookiecutter.project_slug}}/docker-compose.shared.admin.yml

This file was deleted.

This file was deleted.

This file was deleted.

23 changes: 0 additions & 23 deletions {{cookiecutter.project_slug}}/docker-compose.shared.env.yml

This file was deleted.

Loading

0 comments on commit 2afe415

Please sign in to comment.