Created
March 24, 2020 07:51
-
-
Save alexd73/e0fa2a5b960bcad797d04d6d54f0d415 to your computer and use it in GitHub Desktop.
d4d traefik v2 https (сгенерировать как тут https://niklan.net/blog/172#podderzhka-https)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nginx: | |
image: wodby/nginx:$NGINX_TAG | |
container_name: "${PROJECT_NAME}_nginx" | |
depends_on: | |
- php | |
environment: | |
NGINX_STATIC_OPEN_FILE_CACHE: "off" | |
NGINX_ERROR_LOG_LEVEL: debug | |
NGINX_BACKEND_HOST: php | |
NGINX_SERVER_ROOT: /var/www/html/web | |
NGINX_VHOST_PRESET: $NGINX_VHOST_PRESET | |
# NGINX_DRUPAL_FILE_PROXY_URL: http://example.com | |
volumes: | |
- ./:/var/www/html | |
# For macOS users (https://wodby.com/docs/stacks/drupal/local#docker-for-mac) | |
# - ./:/var/www/html:cached # User-guided caching | |
# - docker-sync:/var/www/html # Docker-sync | |
labels: | |
- "traefik.enable=true" | |
- "traefik.http.routers.${PROJECT_NAME}_nginx.rule=Host(`${PROJECT_BASE_URL}`)" | |
- "traefik.http.routers.${PROJECT_NAME}_nginx.entrypoints=http" | |
- "traefik.http.middlewares.${PROJECT_NAME}_https_nginx.redirectscheme.scheme=https" | |
- "traefik.http.routers.${PROJECT_NAME}_https_nginx.rule=Host(`${PROJECT_BASE_URL}`)" | |
- "traefik.http.routers.${PROJECT_NAME}_https_nginx.entrypoints=https" | |
- "traefik.http.routers.${PROJECT_NAME}_https_nginx.tls=true" | |
traefik: | |
image: traefik:v2.0 | |
container_name: "${PROJECT_NAME}_traefik" | |
command: --api.insecure=true --providers.docker | |
# command: -c /dev/null --web --docker --logLevel=DEBUG --defaultEntryPoints='https' --entryPoints="Name:https Address::443 TLS:/certs/api.bayu-bai.docker.localhost.cert,/certs/api.bayu-bai.docker.localhost.key" --entryPoints="Name:http Address::80" | |
ports: | |
- '80:80' | |
- '443:443' | |
- '8080:8080' # Dashboard | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- /etc/localtime:/etc/localtime:ro | |
- ./traefik.yml:/traefik.yml:ro | |
- ./traefik.dynamic.yml:/traefik.dynamic.yml:ro | |
- ./certs:/certs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tls: | |
stores: | |
default: | |
defaultCertificate: | |
certFile: /certs/api.site.docker.localhost.cert | |
keyFile: /certs/api.site.docker.localhost.key | |
certificates: | |
- certFile: /certs/api.site.docker.localhost.cert | |
keyFile: /certs/api.site.docker.localhost.key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
api: | |
dashboard: true | |
log: | |
level: DEBUG | |
filePath: "debug.log" | |
format: txt | |
accessLog: | |
filePath: "access.log" | |
bufferingSize: 100 | |
entryPoints: | |
http: | |
address: ":80" | |
https: | |
address: ":443" | |
providers: | |
file: | |
filename: /traefik.dynamic.yml | |
watch: true | |
docker: | |
endpoint: "unix:///var/run/docker.sock" | |
exposedByDefault: false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment