kamal icon indicating copy to clipboard operation
kamal copied to clipboard

configure volumes, directories and files for any role

Open aka47 opened this issue 1 year ago • 0 comments

For the app, the traefic role, and any accessory you can configure files, volumes, and directories from your project to be accessible inside the docker container.

The files and directories are uploaded to the host and mounted via docker volumes to the docker container. This worked previously only for accessories. So I moved code related to this from accessory configuration to a new class to make it useable for the traefik proxy and the main app as well.

With this change we can add in the config for traefik volumes, files and folders

traefik:
  files:
    - config/traefik.yaml:/etc/traefik/traefik.yaml
  directories:
    - config/traefik.d:/etc/traefik/traefik.d
  volumes:
    - /mnt/volume-data/letsencrypt/acme.json:/letsencrypt/acme.json

For the main app config it looks like this:

volumes:
  - "/mnt/volume-data/wordpress-data:/var/www/html"
files:
  - apache.conf:/etc/apache2/sites-enabled/wp3.conf
directories:
  - config/apache/:/etc/conf-avail

And it works as it currently does for accessories.

accessories:
  redis:
    files:
      - config/redis.conf:/etc/redis/redis.conf
    directories:
      - config/conf.d:/etc/conf/conf.d
    volumes:
      - /mnt/volume-data/conf/conf.json:/conf/conf.json

aka47 avatar Mar 01 '24 15:03 aka47