super-productivity/docker-compose.yaml
Kingsley Yung ab3d2824a5 feat: webdav sync default settings in env variables of container
In the docker setup, allow admin to provide the default values for
WebDAV settings in the "Sync" section of the "Settings" page, via
setting some environment variables of the docker container. This could
be used for single user instances to pre-fill those settings. The
available environment variables are:

- WEBDAV_BASE_URL=<base-url>
- WEBDAV_USERNAME=<username>
- WEBDAV_SYNC_FOLDER_PATH=<sync-folder-path>
- SYNC_INTERVAL=<integer-in-minutes>
- IS_COMPRESSION_ENABLED=<true-or-false>
- IS_ENCRYPTION_ENABLED=<true-or-false>

These configurations are provided as environment variables after the
build process of the app, so they have to be loaded at runtime, instead
of build process. This can be achieved by the following way:

1. The environment variables are loaded into the docker container.
2. The container starts with `docker-entrypoint.sh`.
3. `docker-entrypoint.sh` converts the variables into a JSON file placed
   at `assets/sync-config-default-override.json`.
4. `sync-config.service.ts` fetches
   `assets/sync-config-default-override.json` dynamically at runtime to
override the default values from `default-global-config.const.ts`.
2025-06-11 09:49:17 +02:00

26 lines
836 B
YAML

services:
sp:
image: johannesjo/super-productivity:latest
ports:
- 80:80
environment:
# WebDAV backend served at `/webdav/` subdirectory (Optional)
# Used with "webdav" container below
- WEBDAV_BACKEND=http://webdav
# Default values in "Sync" section in "Settings" page (Optional)
# Useful for single user instances
- WEBDAV_BASE_URL=<base-url>
- WEBDAV_USERNAME=<username>
- WEBDAV_SYNC_FOLDER_PATH=<sync-folder-path>
- SYNC_INTERVAL=<integer-in-minutes>
- IS_COMPRESSION_ENABLED=<true-or-false>
- IS_ENCRYPTION_ENABLED=<true-or-false>
# WebDAV backend server (Optional)
# Used with the WEBDAV_BACKEND environment variable
webdav:
image: hacdias/webdav:latest
volumes:
- ./webdav.yaml:/config.yml:ro
- ./data:/data