- Modifié
Bonjour,
je viens vers vous pour avoir quelques informations.
J'ai lu beaucoup ces derniers temps, et je vois que beaucoup utilise le couple Traefik / Nginx
Il y a t'il une raison à cela ?
Si oui, je suis entrain de tenter de faire un docker-compose qui fasse cohabiter tout cela.
Mais, je n'y arrive pas.
J'utilise le travail de Hardware au niveau de traefik.
Je tente d'y intégrer un Nginx pour l'utilisation de Nextcloud / Wordpress et autre.
C'est vraiment du test et pour tenter de comprendre.
De cette manière j'accède bien à rainloop.
Mais pour la parti webserver, j'ai juste crée un fichier de base html, mais je tombe sur un Bad Gateway
version: "3"
# IPv4 only
# docker network create http_network
# IPv4/IPv6 network
# docker network create http_network --ipv6 --subnet "fd00:0000:0000:0000::/64"
# Refer to https://github.com/hardware/mailserver/#ipv6-support for more information.
networks:
http_network:
external: true
interne_network:
external: false
services:
traefik:
image: traefik:1.7.12-alpine
restart: ${RESTART_MODE}
ports:
- "80:80"
- "443:443"
labels:
- traefik.enable=true
- traefik.frontend.rule=Host:monitor.mondomaine.ndd
- traefik.port=8080
- traefik.docker.network=http_network
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ${VOLUMES_ROOT_PATH}/traefik/traefik.toml:/traefik.toml:ro
- ${VOLUMES_ROOT_PATH}/traefik/acme:/etc/traefik/acme
networks:
- http_network
webserver:
image: nginx:mainline-alpine
restart: ${RESTART_MODE}
domainname: mondomaine.ndd
hostname: ${MAILSERVER_HOSTNAME}
labels:
- traefik.enable=true
- traefik.frontend.rule=Host:mondomaine.ndd,www.mondomaine.ndd
- traefik.port=8888
- traefik.docker.network=http_network
volumes:
- ${VOLUMES_ROOT_PATH}/nginx.conf:/etc/nginx/conf.d/default.conf
- ${VOLUMES_SITES_PATH}/www:/usr/share/nginx/html
depends_on:
- mariadb_wp
- php-fpm
networks:
- interne_network
- http_network
php-fpm:
container_name: php-fpm
image: php:7.3-fpm-alpine
restart: always
labels:
- traefik.enable=false
volumes:
- ${VOLUMES_SITES_PATH}/www:/var/www/html
networks:
- interne_network
# Webmail (Optional)
# https://github.com/hardware/rainloop
# https://www.rainloop.net/
# Configuration : https://github.com/hardware/mailserver/wiki/Rainloop-initial-configuration
rainloop:
image: hardware/rainloop
restart: ${RESTART_MODE}
labels:
- traefik.enable=true
- traefik.port=8888
- traefik.frontend.rule=Host:blog.mondomaine.ndd
- traefik.docker.network=http_network
volumes:
- ${VOLUMES_ROOT_PATH}/rainloop:/rainloop/data
depends_on:
- mariadb_wp
networks:
- http_network
- interne_network
# Database
# https://github.com/docker-library/mariadb
# https://mariadb.org/
mariadb_wp:
image: mariadb:latest
restart: ${RESTART_MODE}
# Info : These variables are ignored when the volume already exists (if databases was created before).
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=yes
- MYSQL_DATABASE=postfix
- MYSQL_USER=postfix
- MYSQL_PASSWORD=${DATABASE_USER_PASSWORD}
volumes:
- ${VOLUMES_ROOT_PATH}/mysql/db:/var/lib/mysql
networks:
- interne_network
# Database PhpMyAdmin
phpmyadmin:
container_name: phpmyadmin
image: phpmyadmin/phpmyadmin
restart: always
depends_on:
- mariadb_wp
labels:
- traefik.backend=phpmyadmin
- traefik.frontend.rule=Host:pma.mondomaine.ndd
- traefik.port=80
networks:
- interne_network
environment:
- PMA_ARBITRARY=1
- PMA_HOST=mariadb_wp
- PMA_PORT=3306
volumes:
- ${VOLUMES_ROOT_PATH}/phpmyadmin:/sessions
traefik.toml
defaultEntryPoints = ["https","http"]
[api]
entryPoint = "traefik"
dashboard = true
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
minVersion = "VersionTLS12"
cipherSuites = [
"TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305",
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256",
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256",
"TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
"TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA"
]
[entryPoints.traefik]
address = ":8080"
[entryPoints.traefik.auth.basic]
users = ["admin:{SHA}jLIjfQZ5yojbZGTqxg2pY0VROWQ="]
[acme]
email = "{{ xxxxxx@xxxx.fr }}"
storage = "/etc/traefik/acme/acme.json"
entryPoint = "https"
onHostRule = true
[acme.tlsChallenge]
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "{{ DOMAIN }}"
watch = true
exposedbydefault = false