See https://docs.docker.com/build/building/multi-stage/#use-an-external-image-as-a-stage The shared volume was making updates complicated, as the persisted volume data would not be overriden by the new container
97 lines
3.2 KiB
YAML
97 lines
3.2 KiB
YAML
services:
|
|
inventaire:
|
|
image: inventaire/inventaire:latest
|
|
env_file: .env
|
|
# You may also build image from sources with:
|
|
# build:
|
|
# context: ./inventaire
|
|
# dockerfile: Dockerfile.inventaire
|
|
depends_on:
|
|
- couchdb
|
|
- elasticsearch
|
|
volumes:
|
|
# The following paths are outside /opt/inventaire so that the inventaire-server volume can be removed
|
|
# (as required when updating the server and client) without loosing their data
|
|
- inventaire-leveldb:/opt/inventaire_leveldb
|
|
- inventaire-local-media-storage:/opt/inventaire_local_media_storage
|
|
- inventaire-backups:/opt/inventaire_backups
|
|
logging:
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
restart: unless-stopped
|
|
couchdb:
|
|
build:
|
|
context: ./couchdb
|
|
dockerfile: Dockerfile.couchdb
|
|
env_file: .env
|
|
environment:
|
|
# See https://docs.couchdb.org/en/stable/maintenance/performance.html#disk-and-file-system-performance
|
|
- 'ERL_FLAGS=+A 4'
|
|
# Uncomment ports to get access to the db
|
|
# ie. for database transformation, querying, UI access (http://localhost:5984/_utils/)
|
|
# /!\ Beware that exposing container ports like this might bypass your firewall rules
|
|
# See https://docs.docker.com/engine/install/ubuntu/#firewall-limitations
|
|
# Keeping it bound to localhost (which is the default) should be safe though
|
|
# (that is, contrary to binding to 0.0.0.0)
|
|
# ports:
|
|
# - "5984:5984"
|
|
volumes:
|
|
- 'couchdb:/opt/couchdb/data'
|
|
restart: unless-stopped
|
|
elasticsearch:
|
|
image: elasticsearch:7.17.28
|
|
environment:
|
|
- 'http.host=elasticsearch'
|
|
- 'transport.host=elasticsearch'
|
|
# See https://www.elastic.co/guide/en/elasticsearch/reference/7.16/docker.html
|
|
- 'discovery.type=single-node'
|
|
# Limit memory usage to 512MB, that should be enough at first
|
|
# See https://www.elastic.co/guide/en/elasticsearch/reference/current/advanced-configuration.html
|
|
- 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
|
|
- 'xpack.security.enabled=false'
|
|
- 'ingest.geoip.downloader.enabled=false'
|
|
- 'logger.org.elasticsearch=ERROR'
|
|
- 'logger.com.azure.core=ERROR'
|
|
- 'logger.org.apache=ERROR'
|
|
volumes:
|
|
- 'elasticsearch:/usr/share/elasticsearch/data'
|
|
restart: unless-stopped
|
|
nginx:
|
|
build:
|
|
context: ./nginx
|
|
dockerfile: Dockerfile.nginx
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./nginx/templates:/etc/nginx/templates/
|
|
- ./nginx/snippets:/etc/nginx/snippets
|
|
- certbot-www:/var/www/html
|
|
- ./certbot/conf:/etc/letsencrypt
|
|
- nginx-cache:/tmp/nginx
|
|
env_file: .env
|
|
depends_on:
|
|
# Required to be able to define the `inventaire` host as an upstream
|
|
- inventaire
|
|
restart: unless-stopped
|
|
certbot:
|
|
image: certbot/certbot:latest
|
|
volumes:
|
|
- ./certbot/conf:/etc/letsencrypt
|
|
- certbot-www:/var/www/html
|
|
restart: unless-stopped
|
|
entrypoint: /bin/sh -c "trap exit TERM; while :; do certbot renew --webroot -w /var/www/html; sleep 12h & wait $${!}; done;"
|
|
depends_on:
|
|
- nginx
|
|
|
|
volumes:
|
|
couchdb:
|
|
elasticsearch:
|
|
certbot-www:
|
|
inventaire-server:
|
|
inventaire-leveldb:
|
|
inventaire-local-media-storage:
|
|
inventaire-backups:
|
|
nginx-cache:
|