Commit graph

3 commits

Author SHA1 Message Date
Johannes Millan
2fa804c07a refactor(e2e): migrate to production Dockerfile for E2E tests
Complete E2E Docker migration (Steps 1-3):

1. Add SPA routing support in nginx (try_files directive)
2. Make APP_PORT configurable via environment variable
3. Migrate docker-compose.e2e.yaml from dev server to production build

Changes:
- docker-compose.e2e.yaml: Use production Dockerfile instead of dev server
  - Remove volume mounts (self-contained production build)
  - Add UNSPLASH build args
  - Add WEBDAV_BACKEND environment variable
  - Reduce healthcheck start_period from 120s to 30s (nginx is faster)
- nginx/default.conf.template: Add try_files for SPA routing, use APP_PORT
- docker-entrypoint.sh: Export APP_PORT with default value

Benefits:
- Production build provides more realistic test environment
- Faster startup (30s vs 120s)
- No dependency on local node_modules
- Matches production deployment more closely
2026-01-21 14:30:24 +01:00
Kingsley Yung
afc6264211 fix: start nginx via its built-in entrypoint script
Our custom `docker-entrypoint.sh` starts nginx by directly calling
`nginx -g "daemon off;"`. However, we need the `docker-entrypoint.sh`
built-in in the nginx docker image to convert `default.conf.template` to
the actual nginx config file. Without going through nginx's
`docker-entrypoint.sh`, the resultant docker image fallback to the
default nginx configuration, which doesn't forward traffic to webdav
backend server.

This patch fixes this by calling the nginx's `docker-entrypoint.sh` at
the end of our custom `docker-entrypoint.sh`.

Fix: The first issue in https://github.com/johannesjo/super-productivity/issues/4545#issuecomment-2974843258
2025-06-17 18:29:02 +02:00
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