Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions postfix-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,20 @@ services:
env_file: .env
ports:
- '25:25'
- '587:587'
volumes:
- certs:/certs:ro
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "nc -w 3 127.0.0.1 25 </dev/null | grep -q '^220'"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
depends_on:
- email
- traefik-certificate-exporter
postgres:
condition: service_healthy
traefik-certificate-exporter:
condition: service_healthy
labels:
- com.github.ravensorb.traefik-certificate-exporter.domain-restart=${SUBDOMAIN:-app}.${DOMAIN},${DOMAIN}

Expand All @@ -37,12 +44,18 @@ services:
- /var/run/docker.sock:/var/run/docker.sock:ro
- traefik-acme:/data:ro
- certs:/certs:rw
healthcheck:
test: ["CMD-SHELL", "[ -f \"/certs/${SUBDOMAIN:-app}.${DOMAIN}.fullchain.pem\" ] || [ -f \"/certs/${DOMAIN}.fullchain.pem\" ]"]
interval: 20s
timeout: 5s
retries: 3
start_period: 5m
depends_on:
- app

volumes:
certs:
## Uncomment the next lines, if traefik is running outside this project
# traefik-acme: # <-- do not change this identifier
# name: traefik-acme # change (only) this to the name of traefik acme storage volume
# external: true
## Uncomment the next lines, if traefik is running outside this project
# traefik-acme: # <-- do not change this identifier
# name: traefik-acme # change (only) this to the name of traefik acme storage volume
# external: true
3 changes: 2 additions & 1 deletion postfix/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ COPY --from=base / /
FROM alpine AS postfix

# install dependencies
RUN apk --no-cache add postfix postfix-pgsql openssl bind-tools \
RUN apk --no-cache add postfix postfix-pgsql openssl bind-tools netcat-openbsd \
&& mkdir -p /templates /etc/postfix/conf.d

COPY docker-entrypoint.sh /docker-entrypoint.sh
Expand All @@ -24,5 +24,6 @@ COPY conf.d /etc/postfix/conf.d/

ENV MAIL_CONFIG=/etc/postfix/conf.d

EXPOSE 25
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["/usr/sbin/postfix", "start-fg"]
4 changes: 4 additions & 0 deletions simple-login-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ services:
depends_on:
init:
condition: service_completed_successfully
postfix:
condition: service_healthy

job-runner:
<<: *sl-defaults
Expand All @@ -99,3 +101,5 @@ services:
depends_on:
init:
condition: service_completed_successfully
email:
condition: service_started