dockerconfig/docker-compose.yaml
2022-11-13 09:29:11 +01:00

146 lines
3.2 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"
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.zathura.leene.dev
- VIRTUAL_PORT=3000
- LETSENCRYPT_HOST=zathura.leene.dev
- LETSENCRYPT_EMAIL=admin@zathura.leene.dev
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:
- ROUNDCUBEMAIL_DB_HOST=pgsqlserver
- VIRTUAL_HOST=inbox.zathura.leene.dev
- VIRTUAL_PORT=9000
- LETSENCRYPT_HOST=zathura.leene.dev
- LETSENCRYPT_EMAIL=admin@zathura.leene.dev
depends_on:
- pgsqlserver
links:
- pgsqlserver
expose:
- "9000"
volumes:
- nginx_html/roundcubemail:/var/www/html
mailserver:
build: ./config/mail
<<: *defaults
image: mailserver/docker-mailserver:latest
container_name: mailserver
hostname: mail
domainname: zathura.leene.dev
ports:
- "25:25"
- "143:143"
- "587:587"
- "993:993"
volumes:
- nginx_certs:/etc/letsencrypt/live/
- 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
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
- ./config/nginx/zathura.leene.dev_location:/etc/nginx/vhost.d/zathura.leene.dev_location:ro
- /var/run/docker.sock:/tmp/docker.sock:z
depends_on:
- ddnsgd
ddnsgd:
<<: *defaults
container_name: "ddnsgd"
image: "ghcr.io/dominickbrasileiro/ddnsgd"
restart: "always"
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
build: ./config/nginx
volumes:
acme-state:
gitea_data:
nginx_certs:
nginx_dhparam:
nginx_html:
nginx_conf:
nginx_vhost:
mail_data:
mail_config:
mail_state:
sql_data: