dp-salad-docs/docker-compose.md
2025-01-04 22:46:09 -07:00

113 lines
3.3 KiB
Markdown

---
title: One File Docker Compose (One File to Rule them all!)
sidebar: false
---
# One File Docker Compose (One File to Rule them all!)
This is the Docker Compose file used for the VM Template, and can be used as a custom template in Portainer.
The custom network listed under "*Networks*" is used for all the applications that you want to connect through the stack. Please replace the **ALL_CAPS_PORTIONS** and the pieces in **square brackets**. These are values that you will want to set yourself.
::: tip
For things like passwords and such, I'd recommend a 26 character random string, using alphanumeric characters in both upper and lower case. These values are crucial that they remain both secret and lengthy.
:::
These values are crucial that they remain both secret and lengthy. You should not need to change these, and some of them will break the application if you try to change them. I'd recommend that you backup your compose file to the cloud in case you need to redo the setup.
```yml
version: "2.1"
services:
swag:
image: lscr.io/linuxserver/swag:latest
container_name: swag
cap_add:
- NET_ADMIN
environment:
- PUID=1000
- PGID=1000
- TZ=America/Phoenix
- URL=[sakura.nt]
- VALIDATION=dns
- SUBDOMAINS=wildcard
- DNSPLUGIN=cloudflare
- EMAIL=[sakurant@gmail.com]
- ONLY_SUBDOMAINS=false
#- EXTRA_DOMAINS= #optional
- STAGING=false
- DOCKER_MODS=linuxserver/mods:universal-docker|linuxserver/mods:swag-auto-reload|linuxserver/mods:swag-dashboard|linuxserver/mods:swag-dbip
volumes:
- /home/[INSERT USER FOLDER HERE]/appdata/swag:/config
ports:
- 443:443
- 80:80
networks:
- [INSERT NETWORK NAME HERE]
restart: unless-stopped
authelia:
container_name: authelia
image: authelia/authelia:latest
expose:
- 9091
volumes:
- /home/[INSERT USER FOLDER HERE]/appdata/authelia:/config
networks:
- [INSERT NETWORK NAME HERE]
restart: unless-stopped
depends_on:
- redis
- mariadb
lldap:
container_name: lldap
image: lldap/lldap:stable
ports:
# For LDAP
- "3890:3890"
# For the web front-end
- "17170:17170"
volumes:
- /home/[INSERT USER FOLDER HERE]/appdata/lldap:/data
networks:
- [INSERT NETWORK NAME HERE]
environment:
- TZ=America/Phoenix
- LLDAP_JWT_SECRET=REPLACE_WITH_RANDOM
- LLDAP_LDAP_USER_PASS=REPLACE_WITH_PASSWORD
- LLDAP_LDAP_BASE_DN=dc=sakura,dc=nt
redis:
container_name: redis
image: bitnami/redis:latest
expose:
- 6379
volumes:
- /home/[INSERT USER FOLDER HERE]/appdata/redis:/bitnami/
environment:
REDIS_PASSWORD: "YOUR_REDIS_PASSWORD"
networks:
- [INSERT NETWORK NAME HERE]
restart: unless-stopped
mariadb:
container_name: mysql
image: linuxserver/mariadb:latest
expose:
- 3306
volumes:
- /home/[INSERT USER FOLDER HERE]/appdata/mariadb:/config
environment:
MYSQL_ROOT_PASSWORD: "YOUR_MYSQL_ROOT_PASSWORD"
MYSQL_ROOT_USER: root
MYSQL_DATABASE: authelia
MYSQL_USER: authelia
MYSQL_PASSWORD: "YOUR_MYSQL_USER_PASSWORD"
networks:
- [INSERT NETWORK NAME HERE]
restart: unless-stopped
networks:
[INSERT NETWORK NAME HERE]:
driver: bridge
external: true
```