Refactor common environment

This commit is contained in:
Florent Guiotte 2023-04-13 11:28:23 +02:00
parent 51698caa22
commit f2541575b4

View File

@ -1,4 +1,9 @@
version: '3' version: '3.4'
x-common-environment: &common-environment
PUID: 1000
PGID: 1000
TZ: Europe/Helsinki
services: services:
@ -11,8 +16,7 @@ services:
- ./bind9/local.db:/etc/bind/local.db - ./bind9/local.db:/etc/bind/local.db
- ./bind9/lan.db:/etc/bind/lan.db - ./bind9/lan.db:/etc/bind/lan.db
- ./bind9/guiotte.db:/etc/bind/guiotte.db - ./bind9/guiotte.db:/etc/bind/guiotte.db
environment: environment: *common-environment
- TZ=Europe/Helsinki
ports: ports:
- "53:53/udp" - "53:53/udp"
@ -23,14 +27,12 @@ services:
cap_add: cap_add:
- NET_ADMIN - NET_ADMIN
environment: environment:
- PUID=1000 <<: *common-environment
- PGID=1000 URL: guiotte.fr
- TZ=Europe/Helsinki SUBDOMAINS: wildcard
- URL=guiotte.fr VALIDATION: dns
- SUBDOMAINS=wildcard DNSPLUGIN: ovh
- VALIDATION=dns EMAIL: florent@guiotte.fr
- DNSPLUGIN=ovh
- EMAIL=florent@guiotte.fr
volumes: volumes:
- ./swag:/config - ./swag:/config
ports: ports:
@ -41,10 +43,7 @@ services:
image: lscr.io/linuxserver/ddclient:latest image: lscr.io/linuxserver/ddclient:latest
container_name: ddclient container_name: ddclient
restart: unless-stopped restart: unless-stopped
environment: environment: *common-environment
- PUID=1000
- PGID=1000
- TZ=Europe/Helsinki
volumes: volumes:
- ./ddclient:/config - ./ddclient:/config
@ -111,10 +110,7 @@ services:
image: lscr.io/linuxserver/syncthing:latest image: lscr.io/linuxserver/syncthing:latest
container_name: syncthing container_name: syncthing
hostname: drmanhattan #optional hostname: drmanhattan #optional
environment: environment: *common-environment
- PUID=1000
- PGID=1000
- TZ=Europe/Helsinki
volumes: volumes:
- ./syncthing:/config - ./syncthing:/config
- /mnt/storage/music/Florent:/music - /mnt/storage/music/Florent:/music
@ -133,13 +129,11 @@ services:
volumes: volumes:
- lychee-db:/config - lychee-db:/config
environment: environment:
- MYSQL_ROOT_PASSWORD=rootpassword <<: *common-environment
- MYSQL_DATABASE=lychee MYSQL_ROOT_PASSWORD: rootpassword
- MYSQL_USER=lychee MYSQL_DATABASE: lychee
- MYSQL_PASSWORD=dbpassword MYSQL_USER: lychee
- PGID=1000 MYSQL_PASSWORD: dbpassword
- PUID=1000
- TZ=Europe/Helsinki
lychee: lychee:
@ -152,14 +146,12 @@ services:
- lychee-config:/config - lychee-config:/config
- lychee-pictures:/pictures - lychee-pictures:/pictures
environment: environment:
- DB_HOST=lychee-db <<: *common-environment
- DB_USERNAME=lychee DB_HOST: lychee-db
- DB_PASSWORD=dbpassword DB_USERNAME: lychee
- DB_DATABASE=lychee DB_PASSWORD: dbpassword
- DB_PORT=3306 DB_DATABASE: lychee
- PGID=1000 DB_PORT: 3306
- PUID=1000
- TZ=Europe/Helsinki
# WIP # WIP
# zotero: # zotero:
@ -188,10 +180,7 @@ services:
container_name: taskserver container_name: taskserver
hostname: dm.guiotte.fr hostname: dm.guiotte.fr
restart: always restart: always
environment: environment: *common-environment
- PUID=1000
- PGID=1000
- TZ=Europe/Helsinki
env_file: env_file:
- taskserver/taskserver.env - taskserver/taskserver.env
ports: ports:
@ -206,10 +195,7 @@ services:
build: slides-notes build: slides-notes
container_name: slides-notes container_name: slides-notes
restart: always restart: always
environment: environment: *common-environment
- PUID=1000
- PGID=1000
- TZ=Europe/Helsinki
volumes: volumes:
- ./slides-notes/slides:/app/slides - ./slides-notes/slides:/app/slides