From 0df33a8626f04d9e064e18fb03814271a6413a80 Mon Sep 17 00:00:00 2001 From: ray Date: Sat, 26 Sep 2020 03:53:17 +0300 Subject: [PATCH] use traefik network --- docker-compose.yml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 29afa4c..23d87cc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,9 @@ version: "3" +networks: + traefik-proxy: + external: true + services: nuxt: build: ./app/ @@ -7,6 +11,8 @@ services: restart: unless-stopped ports: - ${URL_INTERNAL}:3013:3013 + networks: + - traefik-proxy environment: - URL_INTERNAL=${URL_INTERNAL} - URL_CMS=${URL_CMS} @@ -15,19 +21,43 @@ services: - PORT_CMS=${PORT_CMS} command: "npm run start" + labels: + - "traefik.enable=true" + - "traefik.http.routers.leopold-app.entrypoints=http" + - "traefik.http.routers.leopold-app.rule=Host(`leopold.rayelliott.dev`)" + - "traefik.http.middlewares.leopold-app-https-redirect.redirectscheme.scheme=https" + - "traefik.http.routers.leopold-app.middlewares=traefik-https-redirect" + - "traefik.http.routers.leopold-app-secure.entrypoints=https" + - "traefik.http.routers.leopold-app-secure.rule=Host(`leopold.rayelliott.dev`)" + - "traefik.http.routers.leopold-app-secure.tls=true" + - "traefik.http.routers.leopold-app-secure.tls.certresolver=http" + - "traefik.docker.network=traefik-proxy" octobercms: image: aspendigital/octobercms:latest build: ./cms/ - restart: always + restart: unless-stopped ports: - ${URL_INTERNAL}:3014:80 + networks: + - traefik-proxy environment: - ENABLE_CRON=true - APP_DEBUG=false - INIT_PLUGINS=true - APP_URL=${URL_CMS} - CMS_LINK_POLICY=force + labels: + - "traefik.enable=true" + - "traefik.http.routers.leopold-cms.entrypoints=http" + - "traefik.http.routers.leopold-cms.rule=Host(`cms.leopold.rayelliott.dev`)" + - "traefik.http.middlewares.leopold-cms-https-redirect.redirectscheme.scheme=https" + - "traefik.http.routers.leopold-cms.middlewares=traefik-https-redirect" + - "traefik.http.routers.leopold-cms-secure.entrypoints=https" + - "traefik.http.routers.leopold-cms-secure.rule=Host(`cms.leopold.rayelliott.dev`)" + - "traefik.http.routers.leopold-cms-secure.tls=true" + - "traefik.http.routers.leopold-cms-secure.tls.certresolver=http" + - "traefik.docker.network=traefik-proxy" volumes: - ./cms/plugins:/var/www/html/plugins - ./cms/storage/app:/var/www/html/storage/app