dockerconfig/docker-compose.yaml

160 lines
3.5 KiB
YAML
Raw Normal View History

2022-11-05 10:45:43 +01:00
version: "3.8"
2022-10-29 12:07:29 +02:00
2022-11-13 11:32:34 +01:00
2022-10-30 11:25:25 +01:00
networks:
2022-11-05 10:45:43 +01:00
internalnet:
2022-11-06 10:41:10 +01:00
driver: bridge
enable_ipv6: false
2022-11-05 15:00:31 +01:00
2022-10-30 11:25:25 +01:00
2022-11-05 10:45:43 +01:00
x-mail: &defaults
env_file: local.env
networks:
- internalnet
2022-10-29 12:07:29 +02:00
services:
2022-11-05 10:45:43 +01:00
2022-11-06 10:41:10 +01:00
pgsqlserver:
2022-11-05 10:45:43 +01:00
<<: *defaults
container_name: pgsqlserver
2022-10-30 11:25:25 +01:00
image: postgres:15
2022-11-13 09:29:11 +01:00
environment:
2022-11-13 10:41:45 +01:00
- POSTGRES_MULTIPLE_DATABASES=gitea, roundcube
2022-11-13 11:32:34 +01:00
- POSTGRES_PASSWORD=${SQL_PSWD}
2022-10-30 11:25:25 +01:00
volumes:
2022-11-12 16:54:48 +01:00
- sql_data:/var/lib/postgresql/data/:z
- ./config/pg-init-scripts:/docker-entrypoint-initdb.d:ro
2022-10-30 11:25:25 +01:00
restart: always
2022-11-12 16:54:48 +01:00
expose:
- "5432"
2022-10-30 11:25:25 +01:00
2022-11-13 09:29:11 +01:00
gitea:
<<: *defaults
container_name: gitea
image: gitea/gitea
restart: always
environment:
2022-11-13 11:32:34 +01:00
- VIRTUAL_HOST=git.${NGINX_HOST}
2022-11-13 09:29:11 +01:00
- VIRTUAL_PORT=3000
2022-11-13 11:32:34 +01:00
- LETSENCRYPT_HOST=git.${NGINX_HOST}
2022-11-13 09:29:11 +01:00
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
2022-11-05 10:45:43 +01:00
roundcubemail:
<<: *defaults
image: roundcube/roundcubemail:latest-fpm
2022-11-06 10:41:10 +01:00
container_name: roundcubemail
environment:
2022-11-13 11:32:34 +01:00
- VIRTUAL_HOST=inbox.${NGINX_HOST}
2022-11-13 09:29:11 +01:00
- VIRTUAL_PORT=9000
2022-11-13 11:32:34 +01:00
- 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}
2022-10-30 11:25:25 +01:00
depends_on:
2022-11-06 10:41:10 +01:00
- pgsqlserver
2022-11-05 10:45:43 +01:00
links:
2022-11-06 10:41:10 +01:00
- pgsqlserver
2022-11-12 16:54:48 +01:00
expose:
- "9000"
2022-10-30 11:25:25 +01:00
volumes:
2022-11-13 10:19:12 +01:00
- mail_html:/var/www/html:z
2022-11-13 10:41:45 +01:00
- mail_html:/var/www/roundcube:z
2022-11-05 10:45:43 +01:00
mailserver:
2022-11-12 16:54:48 +01:00
build: ./config/mail
2022-11-05 10:45:43 +01:00
<<: *defaults
2022-11-06 10:41:10 +01:00
image: mailserver/docker-mailserver:latest
2022-11-05 10:45:43 +01:00
container_name: mailserver
2022-11-13 10:19:12 +01:00
hostname: inbox
2022-11-13 11:32:34 +01:00
domainname: ${NGINX_HOST}
environment:
- POSTMASTER_ADDRESS=admin@${NGINX_HOST}
2022-10-30 11:25:25 +01:00
ports:
2022-11-05 10:45:43 +01:00
- "25:25"
- "143:143"
- "587:587"
- "993:993"
volumes:
2022-11-13 10:19:12 +01:00
- nginx_certs:/etc/letsencrypt/live:ro
2022-11-12 16:54:48 +01:00
- mail_data:/var/mail/:z
- mail_state:/var/mail-state/:z
- mail_config:/tmp/docker-mailserver/:z
2022-11-05 10:45:43 +01:00
- /etc/localtime:/etc/localtime:ro
cap_add:
- NET_ADMIN
depends_on:
- ddnsgd
restart: always
2022-11-05 15:00:31 +01:00
reverse-proxy:
<<: *defaults
image: nginxproxy/nginx-proxy
container_name: nginx-proxy
restart: always
2022-11-13 11:32:34 +01:00
environment:
- DEFAULT_EMAIL=admin@${NGINX_HOST}
2022-11-05 15:00:31 +01:00
ports:
- "80:80"
- "443:443"
volumes:
2022-11-12 16:54:48 +01:00
- 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
2022-11-13 10:41:45 +01:00
- nginx_html:/usr/share/nginx/html:z
- mail_html:/var/www/roundcube:z
2022-11-13 11:32:34 +01:00
- ./config/nginx/inbox_location:/etc/nginx/vhost.d/inbox.${NGINX_HOST}_location:z
2022-11-06 10:41:10 +01:00
- /var/run/docker.sock:/tmp/docker.sock:z
2022-11-05 15:00:31 +01:00
depends_on:
- ddnsgd
2022-11-05 10:45:43 +01:00
2022-11-05 15:00:31 +01:00
acme-companion:
2022-11-05 10:45:43 +01:00
<<: *defaults
2022-11-05 15:00:31 +01:00
image: nginxproxy/acme-companion
container_name: nginx-proxy-acme
2022-11-05 10:45:43 +01:00
restart: always
2022-11-05 15:00:31 +01:00
volumes_from:
- reverse-proxy
volumes:
2022-11-12 16:54:48 +01:00
- acme-state:/etc/acme.sh
2022-11-06 10:41:10 +01:00
- /var/run/docker.sock:/var/run/docker.sock:z
2022-10-30 11:25:25 +01:00
depends_on:
2022-11-05 15:00:31 +01:00
- ddnsgd
2022-11-13 10:19:12 +01:00
2022-11-13 11:46:27 +01:00
ddnsgd:
<<: *defaults
container_name: "ddnsgd"
image: "ghcr.io/dominickbrasileiro/ddnsgd"
restart: "always"
environment:
- HOSTNAME=${NGINX_HOST}
- USERNAME=${DNS_USERNAME}
- PASSWORD=${DNS_PASSWORD}
2022-11-12 16:54:48 +01:00
volumes:
acme-state:
2022-11-13 09:29:11 +01:00
gitea_data:
2022-11-12 16:54:48 +01:00
nginx_certs:
nginx_dhparam:
nginx_html:
nginx_conf:
nginx_vhost:
mail_data:
mail_config:
mail_state:
2022-11-13 10:19:12 +01:00
mail_html:
2022-11-13 09:29:11 +01:00
sql_data: