chore: layout changes
This commit is contained in:
parent
e615c1819e
commit
83091962a2
6 changed files with 78 additions and 15 deletions
17
README.md
17
README.md
|
@ -1,2 +1,19 @@
|
||||||
# docker-compose
|
# docker-compose
|
||||||
|
|
||||||
|
- [docker-compose](#docker-compose)
|
||||||
|
- [Directory structure](#directory-structure)
|
||||||
|
|
||||||
|
## Directory structure
|
||||||
|
```
|
||||||
|
/opt/docker
|
||||||
|
.
|
||||||
|
├── container-update.sh
|
||||||
|
├── example_stack
|
||||||
|
│ ├── docker-compose.yml
|
||||||
|
│ └── volumes
|
||||||
|
└── example_app
|
||||||
|
├── docker-compose.yml
|
||||||
|
├── docker-compose.yml_bak
|
||||||
|
└── volumes
|
||||||
|
```
|
||||||
|
|
||||||
|
|
31
container-update.sh
Normal file
31
container-update.sh
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
for compose_file in /opt/docker/**/docker-compose.yml; do
|
||||||
|
if [[ $(docker compose -f "$compose_file" ps -q) ]]; then
|
||||||
|
echo "> Updating $compose_file"
|
||||||
|
docker compose -f "$compose_file" pull
|
||||||
|
docker compose -f "$compose_file" up -d --remove-orphans
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
echo "> Skipping $compose_file as it's not running."
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "> Containers have been updated."
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
confirm=n
|
||||||
|
read -p "> Do you want to remove all dangling images? [y/N]" confirm
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if [[ $confirm == [yY] ]]; then
|
||||||
|
docker image prune -f -a
|
||||||
|
echo "> All dangling images have been removed."
|
||||||
|
else
|
||||||
|
echo "> Dangling images haven't been removed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit
|
|
@ -17,7 +17,7 @@ services:
|
||||||
group_add:
|
group_add:
|
||||||
- dialout
|
- dialout
|
||||||
ports:
|
ports:
|
||||||
- 127.0.0.1:38080:8080
|
- "127.0.0.1:38080:8080"
|
||||||
volumes:
|
volumes:
|
||||||
- ./volumes/zigbee2mqtt/data:/app/data
|
- ./volumes/zigbee2mqtt/data:/app/data
|
||||||
- /run/udev:/run/udev:ro
|
- /run/udev:/run/udev:ro
|
||||||
|
@ -33,7 +33,7 @@ services:
|
||||||
container_name: mqtt
|
container_name: mqtt
|
||||||
command: "mosquitto -c /mosquitto-no-auth.conf"
|
command: "mosquitto -c /mosquitto-no-auth.conf"
|
||||||
ports:
|
ports:
|
||||||
- 127.0.0.1:1883:1883
|
- "127.0.0.1:1883:1883"
|
||||||
volumes:
|
volumes:
|
||||||
- ./volumes/mosquitto/conf:/mosquitto/conf
|
- ./volumes/mosquitto/conf:/mosquitto/conf
|
||||||
- ./volumes/mosquitto/data:/mosquitto/data
|
- ./volumes/mosquitto/data:/mosquitto/data
|
||||||
|
|
|
@ -8,7 +8,7 @@ services:
|
||||||
PGID: 1001
|
PGID: 1001
|
||||||
TZ: Europe/Berlin
|
TZ: Europe/Berlin
|
||||||
ports:
|
ports:
|
||||||
- 127.0.0.1:13000:3000
|
- "127.0.0.1:13000:3000"
|
||||||
volumes:
|
volumes:
|
||||||
- ./volumes/config:/app/config
|
- ./volumes/config:/app/config
|
||||||
- ./volumes/icons:/app/public/icons
|
- ./volumes/icons:/app/public/icons
|
||||||
|
|
|
@ -4,9 +4,6 @@ services:
|
||||||
image: mariadb:10.5
|
image: mariadb:10.5
|
||||||
container_name: nc_db
|
container_name: nc_db
|
||||||
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
|
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
|
||||||
- ./volumes/db:/var/lib/mysql
|
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_ROOT_PASSWORD=Subatomic-Lapping0-Untagged-Deceptive-Judge
|
- MYSQL_ROOT_PASSWORD=Subatomic-Lapping0-Untagged-Deceptive-Judge
|
||||||
- MARIADB_AUTO_UPGRADE=1
|
- MARIADB_AUTO_UPGRADE=1
|
||||||
|
@ -14,6 +11,9 @@ services:
|
||||||
env_file:
|
env_file:
|
||||||
- mariadb.env
|
- mariadb.env
|
||||||
- nextcloud.env
|
- nextcloud.env
|
||||||
|
volumes:
|
||||||
|
- ./volumes/db:/var/lib/mysql
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
nc_redis:
|
nc_redis:
|
||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
|
@ -23,11 +23,6 @@ services:
|
||||||
nc_app:
|
nc_app:
|
||||||
image: nextcloud:apache
|
image: nextcloud:apache
|
||||||
container_name: nc_app
|
container_name: nc_app
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
|
||||||
- ./volumes/nextcloud:/var/www/html
|
|
||||||
ports:
|
|
||||||
- "127.0.0.1:28080:80"
|
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_HOST=nc_db
|
- MYSQL_HOST=nc_db
|
||||||
- REDIS_HOST=nc_redis
|
- REDIS_HOST=nc_redis
|
||||||
|
@ -38,18 +33,22 @@ services:
|
||||||
- PHP_UPLOAD_LIMIT=1G
|
- PHP_UPLOAD_LIMIT=1G
|
||||||
env_file:
|
env_file:
|
||||||
- nextcloud.env
|
- nextcloud.env
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:28080:80"
|
||||||
|
volumes:
|
||||||
|
- ./volumes/nextcloud:/var/www/html
|
||||||
depends_on:
|
depends_on:
|
||||||
- nc_db
|
- nc_db
|
||||||
- nc_redis
|
- nc_redis
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
nc_cron:
|
nc_cron:
|
||||||
image: nextcloud:apache
|
image: nextcloud:apache
|
||||||
container_name: nc_cron
|
container_name: nc_cron
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./volumes/nextcloud:/var/www/html
|
- ./volumes/nextcloud:/var/www/html
|
||||||
entrypoint: /cron.sh
|
entrypoint: /cron.sh
|
||||||
depends_on:
|
depends_on:
|
||||||
- nc_db
|
- nc_db
|
||||||
- nc_redis
|
- nc_redis
|
||||||
54,1 Bot
|
restart: unless-stopped
|
||||||
|
|
|
@ -1,12 +1,28 @@
|
||||||
---
|
---
|
||||||
|
name: app_stack
|
||||||
services:
|
services:
|
||||||
service_name:
|
foo:
|
||||||
image:
|
image:
|
||||||
container_name:
|
container_name:
|
||||||
|
command:
|
||||||
environment:
|
environment:
|
||||||
env_file:
|
env_file:
|
||||||
command:
|
|
||||||
ports:
|
ports:
|
||||||
volumes:
|
volumes:
|
||||||
depends_on:
|
depends_on:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
|
bar:
|
||||||
|
image: bar/bar:latest
|
||||||
|
container_name: bar
|
||||||
|
command:
|
||||||
|
environment:
|
||||||
|
- TZ=Europe/Berlin
|
||||||
|
env_file:
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:443:443"
|
||||||
|
volumes:
|
||||||
|
- ./volumes/bar:/bar
|
||||||
|
depends_on:
|
||||||
|
- foo
|
||||||
|
restart: unless-stopped
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue