improve docker-compose setup

This commit is contained in:
lesion 2022-01-26 09:52:52 +01:00
parent 55c066b845
commit 155932d1f3
No known key found for this signature in database
GPG key ID: 352918250B012177
4 changed files with 15 additions and 2 deletions

View file

@ -5,12 +5,13 @@ services:
image: mariadb
container_name: mariadb
volumes:
- ./postgres:/var/lib/postgresql/data
- ./db:/var/lib/mysql
- /etc/localtime:/etc/localtime:ro
environment:
- MARIADB_USER=gancio
- MARIADB_DATABASE=gancio
- MARIADB_PASSWORD=gancio
- MARIADB_RANDOM_ROOT_PASSWORD=yes
restart: always
gancio:
build: .
@ -21,6 +22,11 @@ services:
- PATH=$PATH:/home/node/.yarn/bin
- GANCIO_DATA=/home/node/data
- NODE_ENV=production
- GANCIO_DB_DIALECT=mariadb
- GANCIO_DB_HOST=db
- GANCIO_DB_DATABASE=gancio
- GANCIO_DB_USER=gancio
- GANCIO_DB_PASSWORD=gancio
command: gancio start --docker
entrypoint: /entrypoint.sh
volumes:

View file

@ -24,6 +24,11 @@ services:
- PATH=$PATH:/home/node/.yarn/bin
- GANCIO_DATA=/home/node/data
- NODE_ENV=production
- GANCIO_DB_DIALECT=postgres
- GANCIO_DB_HOST=db
- GANCIO_DB_DATABASE=gancio
- GANCIO_DB_USER=gancio
- GANCIO_DB_PASSWORD=gancio
command: gancio start --docker
entrypoint: /entrypoint.sh
volumes:

View file

@ -10,6 +10,8 @@ services:
- PATH=$PATH:/home/node/.yarn/bin
- GANCIO_DATA=/home/node/data
- NODE_ENV=production
- GANCIO_DB_DIALECT=sqlite
- GANCIO_DB_STORAGE=./gancio.sqlite
entrypoint: /entrypoint.sh
command: gancio start --docker
volumes:

View file

@ -23,7 +23,7 @@ sudo -u postgres pg_dump -Fc gancio > gancio.dump
1. Archive database, configuration, custom user locales, logs, images and thumbnails
```bash
sudo tar -czf gancio-$(date +%Y-%m-%d-%H%M%S)-backup.tgz \
$(ls -d config.json uploads user_locale db.sqlite gancio.dump postgres data logs 2> /dev/null)
$(ls -d config.json uploads user_locale db.sqlite gancio.dump postgres data db logs 2> /dev/null)
```
> info "Automatic backup"