dockerconfig/docker-compose.yaml
2022-11-13 11:46:27 +01:00

160 lines
3.5 KiB
YAML

version: "3.8"
networks:
internalnet:
driver: bridge
enable_ipv6: false
x-mail: &defaults
env_file: local.env
networks:
- internalnet
services:
pgsqlserver:
<<: *defaults
container_name: pgsqlserver
image: postgres:15
environment:
- POSTGRES_MULTIPLE_DATABASES=gitea, roundcube
- POSTGRES_PASSWORD=${SQL_PSWD}
volumes:
- sql_data:/var/lib/postgresql/data/:z
- ./config/pg-init-scripts:/docker-entrypoint-initdb.d:ro
restart: always
expose:
- "5432"
gitea:
<<: *defaults
container_name: gitea
image: gitea/gitea
restart: always
environment:
- VIRTUAL_HOST=git.${NGINX_HOST}
- VIRTUAL_PORT=3000
- LETSENCRYPT_HOST=git.${NGINX_HOST}
volumes:
- gitea_data:/data:z
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
expose:
- "3000"
ports:
- "222:22"
depends_on:
- pgsqlserver
links:
- pgsqlserver
roundcubemail:
<<: *defaults
image: roundcube/roundcubemail:latest-fpm
container_name: roundcubemail
environment:
- VIRTUAL_HOST=inbox.${NGINX_HOST}
- VIRTUAL_PORT=9000
- LETSENCRYPT_HOST=inbox.${NGINX_HOST}
- ROUNDCUBEMAIL_DB_HOST=pgsqlserver
- ROUNDCUBEMAIL_DEFAULT_HOST=tls://${NGINX_HOST}
- ROUNDCUBEMAIL_SMTP_SERVER=tls://${NGINX_HOST}
- ROUNDCUBEMAIL_DB_PASSWORD=${SQL_PSWD}
depends_on:
- pgsqlserver
links:
- pgsqlserver
expose:
- "9000"
volumes:
- mail_html:/var/www/html:z
- mail_html:/var/www/roundcube:z
mailserver:
build: ./config/mail
<<: *defaults
image: mailserver/docker-mailserver:latest
container_name: mailserver
hostname: inbox
domainname: ${NGINX_HOST}
environment:
- POSTMASTER_ADDRESS=admin@${NGINX_HOST}
ports:
- "25:25"
- "143:143"
- "587:587"
- "993:993"
volumes:
- nginx_certs:/etc/letsencrypt/live:ro
- mail_data:/var/mail/:z
- mail_state:/var/mail-state/:z
- mail_config:/tmp/docker-mailserver/:z
- /etc/localtime:/etc/localtime:ro
cap_add:
- NET_ADMIN
depends_on:
- ddnsgd
restart: always
reverse-proxy:
<<: *defaults
image: nginxproxy/nginx-proxy
container_name: nginx-proxy
restart: always
environment:
- DEFAULT_EMAIL=admin@${NGINX_HOST}
ports:
- "80:80"
- "443:443"
volumes:
- nginx_dhparam:/etc/nginx/dhparam:z
- nginx_certs:/etc/nginx/certs/:z
- nginx_conf:/etc/nginx/conf.d/:z
- nginx_vhost:/etc/nginx/vhost.d/:z
- nginx_html:/usr/share/nginx/html:z
- mail_html:/var/www/roundcube:z
- ./config/nginx/inbox_location:/etc/nginx/vhost.d/inbox.${NGINX_HOST}_location:z
- /var/run/docker.sock:/tmp/docker.sock:z
depends_on:
- ddnsgd
acme-companion:
<<: *defaults
image: nginxproxy/acme-companion
container_name: nginx-proxy-acme
restart: always
volumes_from:
- reverse-proxy
volumes:
- acme-state:/etc/acme.sh
- /var/run/docker.sock:/var/run/docker.sock:z
depends_on:
- ddnsgd
ddnsgd:
<<: *defaults
container_name: "ddnsgd"
image: "ghcr.io/dominickbrasileiro/ddnsgd"
restart: "always"
environment:
- HOSTNAME=${NGINX_HOST}
- USERNAME=${DNS_USERNAME}
- PASSWORD=${DNS_PASSWORD}
volumes:
acme-state:
gitea_data:
nginx_certs:
nginx_dhparam:
nginx_html:
nginx_conf:
nginx_vhost:
mail_data:
mail_config:
mail_state:
mail_html:
sql_data: