dockerconfig/docker-compose.yaml

223 lines
6.3 KiB
YAML
Raw Normal View History

2022-11-18 11:05:32 +01:00
version: "3.8"
networks:
internalnet:
driver: bridge
enable_ipv6: false
2023-12-30 13:31:49 +01:00
x-mail:
&defaults
restart: unless-stopped
2022-11-18 11:05:32 +01:00
env_file: local.env
networks:
- internalnet
2022-10-29 12:07:29 +02:00
services:
2023-12-30 13:31:49 +01:00
certbot:
<<: *defaults
2024-09-21 16:01:38 +02:00
image: certbot/dns-cloudflare
2023-12-30 13:31:49 +01:00
container_name: certbot
2024-09-21 16:01:38 +02:00
command: certonly --non-interactive --dns-cloudflare --dns-cloudflare-credentials /config/credentials.ini --agree-tos --email admin@${NGINX_HOST} -d ${NGINX_HOST} -d mail.${NGINX_HOST} -d inbox.${NGINX_HOST} -d lieuwe.${NGINX_HOST} -d nextcloud.${NGINX_HOST} -d git.${NGINX_HOST} --server https://acme-v02.api.letsencrypt.org/directory
2023-12-30 13:31:49 +01:00
volumes:
- certbot_state:/var/lib/letsencrypt:z
- nginx_archive:/etc/letsencrypt/archive:z
- nginx_certs:/etc/letsencrypt/live:z
2024-09-21 16:01:38 +02:00
- ./config/nginx/credentials.ini:/config/credentials.ini:ro,z
2023-12-30 13:31:49 +01:00
2022-11-19 14:44:58 +01:00
hugo-html:
2023-12-30 13:31:49 +01:00
networks:
- internalnet
2022-11-19 14:44:58 +01:00
container_name: hugo-html
build:
context: ./config/hugo
args:
HUGO_BASE: lieuwe.${NGINX_HOST}
volumes:
- hugo_data:/public:z
2022-11-18 11:05:32 +01:00
hugo-site:
<<: *defaults
container_name: hugo-site
2022-11-13 17:58:23 +01:00
image: nginx:alpine
2022-11-18 11:05:32 +01:00
environment:
- VIRTUAL_PORT=6262
- VIRTUAL_PROTO=http
2022-11-19 14:44:58 +01:00
- VIRTUAL_HOST=lieuwe.${NGINX_HOST}
2022-11-18 11:05:32 +01:00
- LETSENCRYPT_HOST=lieuwe.${NGINX_HOST}
2022-11-13 12:36:43 +01:00
volumes:
2022-11-19 14:44:58 +01:00
- hugo_data:/var/www/html:ro,z
2022-11-18 11:05:32 +01:00
- ./config/hugo/configure:/etc/nginx/templates/default.conf.template:ro,z
2022-11-19 14:44:58 +01:00
ports:
- "6262:6262"
2022-11-14 16:02:40 +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-19 14:44:58 +01:00
- POSTGRES_MULTIPLE_DATABASES=gitea, roundcube, nextcloud
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
2022-11-14 16:02:40 +01:00
- ./config/pg-init-scripts:/docker-entrypoint-initdb.d:ro,z
2022-11-19 14:44:58 +01:00
ports:
- "5432:5432"
2023-04-24 11:44:33 +02:00
healthcheck:
test: "pg_isready"
timeout: 45s
interval: 10s
retries: 10
2022-11-19 14:44:58 +01:00
nextcloud:
<<: *defaults
image: nextcloud:fpm
container_name: nextcloud
environment:
- VIRTUAL_HOST=nextcloud.${NGINX_HOST}
- VIRTUAL_PORT=9000
- LETSENCRYPT_HOST=nextcloud.${NGINX_HOST}
- POSTGRES_HOST=pgsqlserver
- POSTGRES_PORT=5432
- POSTGRES_DB=nextcloud
- POSTGRES_USER=nextcloud
- POSTGRES_PASSWORD=${SQL_PSWD}
- NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.${NGINX_HOST}
- NEXTCLOUD_ADMIN_USER=penny
- NEXTCLOUD_ADMIN_PASSWORD=${SQL_PSWD}
- SMTP_HOST=mailserver
- SMTP_SECURE=tls
- SMTP_NAME=admin@${NGINX_HOST}
- SMTP_PASSWORD=${SQL_PSWD}
depends_on:
2023-04-24 11:44:33 +02:00
pgsqlserver:
condition: service_healthy
2022-11-19 14:44:58 +01:00
links:
- pgsqlserver
2022-11-12 16:54:48 +01:00
expose:
2022-11-19 14:44:58 +01:00
- "9000"
volumes:
- nextcloud_data:/var/www/html:z
- nextcloud_data:/var/www/nextcloud:z
2022-10-30 11:25:25 +01:00
2022-11-13 09:29:11 +01:00
gitea:
<<: *defaults
container_name: gitea
image: gitea/gitea
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}
- GITEA__mailer__PASSWD=${SQL_PSWD}
- GITEA__server__DOMAIN=git.${NGINX_HOST}
- GITEA__server__SSH_DOMAIN=git.${NGINX_HOST}
- GITEA__server__ROOT_URL=https://git.${NGINX_HOST}/
- GITEA__server__CERT_FILE=/etc/letsencrypt/live/git.${NGINX_HOST}.crt
- GITEA__server__KEY_FILE=/etc/letsencrypt/live/git.${NGINX_HOST}.key
2022-11-13 09:29:11 +01:00
volumes:
- gitea_data:/data:z
2023-12-30 13:31:49 +01:00
- nginx_archive:/etc/letsencrypt/archive:ro,z
- nginx_certs:/etc/letsencrypt/live:ro,z
2022-11-13 09:29:11 +01:00
expose:
- "3000"
ports:
- "222:22"
depends_on:
2023-04-24 11:44:33 +02:00
pgsqlserver:
condition: service_healthy
2022-11-13 09:29:11 +01:00
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:
2023-04-24 11:44:33 +02:00
pgsqlserver:
condition: service_healthy
2022-11-05 10:45:43 +01:00
links:
2022-11-06 10:41:10 +01:00
- pgsqlserver
2022-11-18 11:05:32 +01:00
expose:
2022-11-12 16:54:48 +01:00
- "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-19 14:44:58 +01:00
- ./config/mail/config.php:/var/roundcube/config/${NGINX_HOST}.php:ro,z
2022-11-05 10:45:43 +01:00
mailserver:
<<: *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:
- VIRTUAL_HOST=mail.${NGINX_HOST}
- LETSENCRYPT_HOST=mail.${NGINX_HOST}
- SSL_TYPE=manual
- SSL_CERT_PATH=/etc/letsencrypt/live/mail.${NGINX_HOST}.crt
- SSL_KEY_PATH=/etc/letsencrypt/live/mail.${NGINX_HOST}.key
2022-11-13 11:32:34 +01:00
- POSTMASTER_ADDRESS=admin@${NGINX_HOST}
- RELAY_PASSWORD=${SENDGRID_APIKEY}
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:
2023-12-30 13:31:49 +01:00
- nginx_archive:/etc/letsencrypt/archive:ro,z
2022-11-19 14:44:58 +01:00
- nginx_certs:/etc/letsencrypt/live:ro,z
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
- ./config/mail/postfix-policyd-spf.conf:/etc/postfix-policyd-spf-python/policyd-spf.conf:ro,z
2022-11-05 10:45:43 +01:00
cap_add:
- NET_ADMIN
2022-11-05 15:00:31 +01:00
reverse-proxy:
<<: *defaults
2023-04-24 11:44:33 +02:00
image: nginxproxy/nginx-proxy:1.2.3
2022-11-05 15:00:31 +01:00
container_name: nginx-proxy
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-14 16:02:40 +01:00
- nginx_html:/usr/share/nginx/html:z
- nginx_conf:/etc/nginx/conf.d/:z
2022-11-12 16:54:48 +01:00
- nginx_dhparam:/etc/nginx/dhparam:z
2023-12-30 13:31:49 +01:00
- nginx_archive:/etc/nginx/archive/:ro,z
- nginx_certs:/etc/nginx/certs/:z
2022-11-12 16:54:48 +01:00
- nginx_vhost:/etc/nginx/vhost.d/:z
2022-11-13 10:41:45 +01:00
- mail_html:/var/www/roundcube:z
2022-11-19 14:44:58 +01:00
- nextcloud_data:/var/www/nextcloud:z
2022-11-14 16:02:40 +01:00
- ./config/nginx/inbox_location:/etc/nginx/vhost.d/inbox.${NGINX_HOST}_location:ro,z
2022-11-19 14:44:58 +01:00
- ./config/nginx/nextcloud_location:/etc/nginx/vhost.d/nextcloud.${NGINX_HOST}_location:ro,z
- ./config/nginx/header_default:/etc/nginx/vhost.d/default:z
2022-11-14 16:02:40 +01:00
- /var/run/docker.sock:/tmp/docker.sock:ro,z
2022-11-19 18:55:06 +01:00
2022-11-12 16:54:48 +01:00
volumes:
2023-12-30 13:31:49 +01:00
certbot_state:
nginx_archive:
nginx_certs:
2022-11-13 09:29:11 +01:00
gitea_data:
2022-11-19 14:44:58 +01:00
hugo_data:
nextcloud_data:
2022-11-12 16:54:48 +01:00
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: