Added replicas variables for core containers

- Added back restart: always on compose flavor
- Moved Log driver from .env to docker-compose.yml
master
Ionut Filip 6 years ago
parent 6a9e5c1921
commit 3c9cae5d06

@ -10,13 +10,17 @@ services:
# External dependencies # External dependencies
redis: redis:
image: redis:alpine image: redis:alpine
restart: always
volumes: volumes:
- "{{ root }}/redis:/data" - "{{ root }}/redis:/data"
# Core services # Core services
front: front:
image: mailu/nginx:{{ version }} image: mailu/nginx:{{ version }}
restart: always
env_file: {{ env }} env_file: {{ env }}
logging:
driver: {{ log_driver or 'json-file' }}
ports: ports:
{% for port in (80, 443, 25, 465, 587, 110, 995, 143, 993) %} {% for port in (80, 443, 25, 465, 587, 110, 995, 143, 993) %}
{% if bind4 %} {% if bind4 %}
@ -31,6 +35,7 @@ services:
admin: admin:
image: mailu/admin:{{ version }} image: mailu/admin:{{ version }}
restart: always
env_file: {{ env }} env_file: {{ env }}
{% if not admin_enabled %} {% if not admin_enabled %}
ports: ports:
@ -44,6 +49,7 @@ services:
imap: imap:
image: mailu/dovecot:{{ version }} image: mailu/dovecot:{{ version }}
restart: always
env_file: {{ env }} env_file: {{ env }}
volumes: volumes:
- "{{ root }}/mail:/mail" - "{{ root }}/mail:/mail"
@ -53,6 +59,7 @@ services:
smtp: smtp:
image: mailu/postfix:{{ version }} image: mailu/postfix:{{ version }}
restart: always
env_file: {{ env }} env_file: {{ env }}
volumes: volumes:
- "{{ root }}/overrides:/overrides" - "{{ root }}/overrides:/overrides"
@ -63,6 +70,7 @@ services:
{% if antispam_enabled %} {% if antispam_enabled %}
antispam: antispam:
image: mailu/rspamd:{{ version }} image: mailu/rspamd:{{ version }}
restart: always
env_file: {{ env }} env_file: {{ env }}
volumes: volumes:
- "{{ root }}/filter:/var/lib/rspamd" - "{{ root }}/filter:/var/lib/rspamd"
@ -75,6 +83,7 @@ services:
{% if antivirus_enabled %} {% if antivirus_enabled %}
antivirus: antivirus:
image: mailu/clamav:{{ version }} image: mailu/clamav:{{ version }}
restart: always
env_file: {{ env }} env_file: {{ env }}
volumes: volumes:
- "{{ root }}/filter:/data" - "{{ root }}/filter:/data"
@ -83,6 +92,7 @@ services:
{% if webdav_enabled %} {% if webdav_enabled %}
webdav: webdav:
image: mailu/radicale:{{ version }} image: mailu/radicale:{{ version }}
restart: always
env_file: {{ env }} env_file: {{ env }}
volumes: volumes:
- "{{ root }}/dav:/data" - "{{ root }}/dav:/data"
@ -91,6 +101,7 @@ services:
{% if fetchmail_enabled %} {% if fetchmail_enabled %}
fetchmail: fetchmail:
image: mailu/fetchmail:{{ version }} image: mailu/fetchmail:{{ version }}
restart: always
env_file: {{ env }} env_file: {{ env }}
{% endif %} {% endif %}
@ -98,6 +109,7 @@ services:
{% if webmail_type != 'none' %} {% if webmail_type != 'none' %}
webmail: webmail:
image: mailu/{{ webmail_type }}:{{ version }} image: mailu/{{ webmail_type }}:{{ version }}
restart: always
env_file: {{ env }} env_file: {{ env }}
volumes: volumes:
- "{{ root }}/webmail:/data" - "{{ root }}/webmail:/data"

@ -138,7 +138,7 @@ DOMAIN_REGISTRATION=true
# json-file (default) # json-file (default)
# journald (On systemd platforms, useful for Fail2Ban integration) # journald (On systemd platforms, useful for Fail2Ban integration)
# syslog (Non systemd platforms, Fail2Ban integration. Disables `docker-compose log` for front!) # syslog (Non systemd platforms, Fail2Ban integration. Disables `docker-compose log` for front!)
LOG_DRIVER={{ log_driver or 'json-file' }} # LOG_DRIVER={{ log_driver or 'json-file' }}
# Docker-compose project name, this will prepended to containers names. # Docker-compose project name, this will prepended to containers names.
COMPOSE_PROJECT_NAME={{ compose_project_name or 'mailu' }} COMPOSE_PROJECT_NAME={{ compose_project_name or 'mailu' }}

@ -10,7 +10,6 @@ services:
# External dependencies # External dependencies
redis: redis:
image: redis:alpine image: redis:alpine
restart: always
volumes: volumes:
- "{{ root }}/redis:/data" - "{{ root }}/redis:/data"
@ -18,6 +17,8 @@ services:
front: front:
image: mailu/nginx:{{ version }} image: mailu/nginx:{{ version }}
env_file: {{ env }} env_file: {{ env }}
logging:
driver: {{ log_driver or 'json-file' }}
ports: ports:
{% for port in (80, 443, 25, 465, 587, 110, 995, 143, 993) %} {% for port in (80, 443, 25, 465, 587, 110, 995, 143, 993) %}
- target: {{ port }} - target: {{ port }}
@ -27,7 +28,7 @@ services:
volumes: volumes:
- "{{ root }}/certs:/certs" - "{{ root }}/certs:/certs"
deploy: deploy:
replicas: 1 replicas: {{ front_replicas }}
admin: admin:
image: mailu/admin:{{ version }} image: mailu/admin:{{ version }}
@ -40,7 +41,7 @@ services:
- "{{ root }}/data:/data" - "{{ root }}/data:/data"
- "{{ root }}/dkim:/dkim" - "{{ root }}/dkim:/dkim"
deploy: deploy:
replicas: 1 replicas: {{ admin_replicas }}
imap: imap:
image: mailu/dovecot:{{ version }} image: mailu/dovecot:{{ version }}
@ -52,7 +53,7 @@ services:
- "{{ root }}/mail:/mail" - "{{ root }}/mail:/mail"
- "{{ root }}/overrides:/overrides" - "{{ root }}/overrides:/overrides"
deploy: deploy:
replicas: 1 replicas: {{ imap_replicas }}
smtp: smtp:
image: mailu/postfix:{{ version }} image: mailu/postfix:{{ version }}
@ -62,7 +63,7 @@ services:
volumes: volumes:
- "{{ root }}/overrides:/overrides" - "{{ root }}/overrides:/overrides"
deploy: deploy:
replicas: 1 replicas: {{ smtp_replicas }}
# Optional services # Optional services
{% if antispam_enabled %} {% if antispam_enabled %}

@ -5,7 +5,8 @@ you expose it to the world.</p>
<div class="form-group"> <div class="form-group">
<label>Subnet</label> <label>Subnet</label>
<input class="form-control" type="text" name="subnet" required pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))$"> <input class="form-control" type="text" name="subnet" required pattern="^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))$"
value="10.0.1.0/24">
</div> </div>
<p>You server will be available under a main hostname but may expose multiple public <p>You server will be available under a main hostname but may expose multiple public

@ -0,0 +1,28 @@
{% call macros.panel("info", "Step 5 - Number of replicas for containers") %}
<p>Select number of replicas for containers</p>
<div class="form-group">
<input class="form-control" type="number" name="front_replicas" min="1" required value="1"
style="width: 6%; display: inline;">
<label>Front</label>
</div>
<div class="form-group">
<input class="form-control" type="number" name="admin_replicas" min="1" required value="1"
style="width: 6%; display: inline;">
<label>Admin</label>
</div>
<div class="form-group">
<input class="form-control" type="number" name="imap_replicas" min="1" required value="1"
style="width: 6%; display: inline;">
<label>IMAP</label>
</div>
<div class="form-group">
<input class="form-control" type="number" name=smtp_replicas min="1" required value="1"
style="width: 6%; display: inline;">
<label>SMPT</label>
</div>
{% endcall %}
Loading…
Cancel
Save