Changed Dockerfile to use APP_PORT instead of PORT to match
docker-entrypoint.sh and nginx template. This prevents confusion
about which environment variable controls the nginx port.
The prepare script requires both plugin-api and shared-schema packages
to be available during the Docker build, but only plugin-api was being
copied into the build context. This caused the build to fail when trying
to run 'cd packages/shared-schema'.
- Always read system environment variables first, then override with .env file
- Ensure all required keys are always present in generated types
- Pass environment variables correctly in Docker build
- Update .dockerignore to exclude build artifacts
- Fix GPG signature errors during apt-get update by using DEBIAN_FRONTEND=noninteractive
- Fix npm install failures by copying plugin-api files before running npm ci
- Use npm ci --ignore-scripts followed by npm run prepare to handle dependencies properly
- Ensure git is configured for HTTPS to handle git-based dependencies
This resolves the Docker Hub build failures seen in GitHub Actions.
The Docker build was failing because nginx:1-alpine might not have jq version 1.7.1-r0 available. By removing the version constraint, Alpine will install the latest compatible version available in its repositories.
This patch reorders some commands in `Dockerfile` to save time on
building the docker image.
The main goal is to only copy `package.json` and `package-lock.json`
into the docker environment before installing dependencies via npm.
Therefore, if the dependencies do not change (but other files may
change), `docker build` will automatically use cached layers in previous
build, instead of re-downloading the same set of dependencies again.
This could save build time, especially during development at local
machine.
Furthermore, use `npm ci` instead of `npm i` can speed up the build
process in CI environment.
However, I notice that `package.json` and `package-lock.json` are out of
sync now. So, `npm i` remains in `Dockerfile` as fallback for now. Once
the two json files are in sync, this fallback can be removed.
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
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`.
This patch provides an optional way to integrate an external WebDAV server so that the super-productivity container can serve as a WebDAV server with base url http://localhost/webdav/ . It includes the following changes:
**Replace the default nginx config file**
Besides serving the web app, the new nginx config file also forwards all the requests with paths starting with "/webdav/" to a backend WebDAV server specified by the environment variable WEBDAV_BACKEND. Note that during forwarding, the path prefix "/webdav" will be removed.
**Use hacdias/webdav as default WebDAV backend server**
The docker-compose.yaml provides an example setup to use the docker image [hacdias/webdav](https://github.com/hacdias/webdav) as the WebDAV backend server. An example for the configuration of the WebDAV server is also provided in webdav.yaml.