feat(infra): Added way to run custom commands for different services

- new `EXTRA_FILES` docker build args to specify directory to be copied at
  /extra
- run `${SERVICE}/entrypoint.sh` as docker entry point
- added src/empty folder to so if EXTRA_FILES isn't set => use empty
  folder (since no conditional COPY)
This commit is contained in:
Maieul BOYER 2025-08-04 14:21:42 +02:00
parent 1ebe0868f5
commit a2b896916e
6 changed files with 35 additions and 10 deletions

View file

@ -19,19 +19,20 @@ services:
volumes:
# if you need to share files with nginx, you do it here.
- images-volume:/volumes/icons
# - static-volume:/volumes/static
environment:
# this can stay the same for developpement. This is an alias to `localhost`
- NGINX_DOMAIN=local.maix.me
# an example of an micro service. this one basically only does this:
# - handle uploading of icons
# - write icons to shared volume allowing nginx to serve them (does it better than if we did it in the service)
###############
# ICONS #
###############
icons:
# build is a bit strange: it has two parts
build:
build:
context: ./src/
args:
- SERVICE=icons
#- EXTRA_FILES=icons/extra
container_name: icons
restart: always
networks:
@ -42,6 +43,9 @@ services:
environment:
- USER_ICONS_STORE=/store
- DATABASE_DIR=/database
volumes:
images-volume:
sqlite-volume:
static-volume: