Prepare the docker compose configuration for nginx as a uninque frontend

master
kaiyou 7 years ago
parent 755d9f0520
commit 67423b057d

@ -38,8 +38,8 @@ TLS_FLAVOR=cert
# Optional features # Optional features
################################### ###################################
# Choose which frontend Web server to run if any (value: traefik, none) # Expose the admin interface (value: true, false)
FRONTEND=none ADMIN=false
# Choose which webmail to run if any (values: roundcube, rainloop, none) # Choose which webmail to run if any (values: roundcube, rainloop, none)
WEBMAIL=none WEBMAIL=none
@ -87,6 +87,3 @@ COMPOSE_PROJECT_NAME=mailu
# (value: SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT) # (value: SHA512-CRYPT, SHA256-CRYPT, MD5-CRYPT, CRYPT)
PASSWORD_SCHEME=SHA512-CRYPT PASSWORD_SCHEME=SHA512-CRYPT
# SSL DHPARAM Bits
NGINX_SSL_DHPARAM_BITS=2048

@ -2,17 +2,23 @@ version: '2'
services: services:
http: front:
# build: $FRONTEND # build: nginx
image: mailu/$FRONTEND:$VERSION image: mailu/nginx:$VERSION
restart: always restart: always
env_file: .env env_file: .env
ports: ports:
- "$BIND_ADDRESS:80:80" - "$BIND_ADDRESS:80:80"
- "$BIND_ADDRESS:443:443" - "$BIND_ADDRESS:443:443"
- "$BIND_ADDRESS:110:110"
- "$BIND_ADDRESS:143:143"
- "$BIND_ADDRESS:993:993"
- "$BIND_ADDRESS:995:995"
- "$BIND_ADDRESS:25:25"
- "$BIND_ADDRESS:465:465"
- "$BIND_ADDRESS:587:587"
volumes: volumes:
- "$ROOT/certs:/certs" - "$ROOT/certs:/certs"
- /var/run/docker.sock:/docker.sock:ro
redis: redis:
image: redis:latest image: redis:latest
@ -25,16 +31,9 @@ services:
image: mailu/dovecot:$VERSION image: mailu/dovecot:$VERSION
restart: always restart: always
env_file: .env env_file: .env
ports:
- "$BIND_ADDRESS:110:110"
- "$BIND_ADDRESS:143:143"
- "$BIND_ADDRESS:993:993"
- "$BIND_ADDRESS:995:995"
- "$BIND_ADDRESS:4190:4190"
volumes: volumes:
- "$ROOT/data:/data" - "$ROOT/data:/data"
- "$ROOT/mail:/mail" - "$ROOT/mail:/mail"
- "$ROOT/certs:/certs"
- "$ROOT/overrides:/overrides" - "$ROOT/overrides:/overrides"
smtp: smtp:
@ -42,13 +41,8 @@ services:
image: mailu/postfix:$VERSION image: mailu/postfix:$VERSION
restart: always restart: always
env_file: .env env_file: .env
ports:
- "$BIND_ADDRESS:25:25"
- "$BIND_ADDRESS:465:465"
- "$BIND_ADDRESS:587:587"
volumes: volumes:
- "$ROOT/data:/data" - "$ROOT/data:/data"
- "$ROOT/certs:/certs"
- "$ROOT/overrides:/overrides" - "$ROOT/overrides:/overrides"
milter: milter:
@ -88,29 +82,16 @@ services:
admin: admin:
# build: admin # build: admin
image: mailu/admin:$VERSION image: mailu/admin:$VERSION
labels:
- traefik.enable=true
- traefik.admin.frontend.rule=Host:$HOSTNAME;PathPrefixStrip:/admin/
- traefik.admin.port=80
- traefik.home.frontend.rule=Host:$HOSTNAME;Path:/
- traefik.home.port=80
restart: always restart: always
env_file: .env env_file: .env
ports:
- "127.0.0.1:8000:80"
volumes: volumes:
- "$ROOT/data:/data" - "$ROOT/data:/data"
- "$ROOT/dkim:/dkim" - "$ROOT/dkim:/dkim"
- "$ROOT/certs:/certs"
- /var/run/docker.sock:/var/run/docker.sock:ro - /var/run/docker.sock:/var/run/docker.sock:ro
webmail: webmail:
# build: "$WEBMAIL" # build: "$WEBMAIL"
image: "mailu/$WEBMAIL:$VERSION" image: "mailu/$WEBMAIL:$VERSION"
labels:
- traefik.enable=true
- traefik.frontend.rule=Host:$HOSTNAME;PathPrefixStrip:/webmail/
- traefik.port=80
restart: always restart: always
env_file: .env env_file: .env
volumes: volumes:

Loading…
Cancel
Save