use traefik network

This commit is contained in:
ray 2020-09-26 03:53:17 +03:00
parent aa6d5ee183
commit 0df33a8626
1 changed files with 31 additions and 1 deletions

View File

@ -1,5 +1,9 @@
version: "3" version: "3"
networks:
traefik-proxy:
external: true
services: services:
nuxt: nuxt:
build: ./app/ build: ./app/
@ -7,6 +11,8 @@ services:
restart: unless-stopped restart: unless-stopped
ports: ports:
- ${URL_INTERNAL}:3013:3013 - ${URL_INTERNAL}:3013:3013
networks:
- traefik-proxy
environment: environment:
- URL_INTERNAL=${URL_INTERNAL} - URL_INTERNAL=${URL_INTERNAL}
- URL_CMS=${URL_CMS} - URL_CMS=${URL_CMS}
@ -15,19 +21,43 @@ services:
- PORT_CMS=${PORT_CMS} - PORT_CMS=${PORT_CMS}
command: command:
"npm run start" "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: octobercms:
image: aspendigital/octobercms:latest image: aspendigital/octobercms:latest
build: ./cms/ build: ./cms/
restart: always restart: unless-stopped
ports: ports:
- ${URL_INTERNAL}:3014:80 - ${URL_INTERNAL}:3014:80
networks:
- traefik-proxy
environment: environment:
- ENABLE_CRON=true - ENABLE_CRON=true
- APP_DEBUG=false - APP_DEBUG=false
- INIT_PLUGINS=true - INIT_PLUGINS=true
- APP_URL=${URL_CMS} - APP_URL=${URL_CMS}
- CMS_LINK_POLICY=force - 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: volumes:
- ./cms/plugins:/var/www/html/plugins - ./cms/plugins:/var/www/html/plugins
- ./cms/storage/app:/var/www/html/storage/app - ./cms/storage/app:/var/www/html/storage/app