Commit graph

13 commits

Author SHA1 Message Date
Kingsley Yung
33bacc37fa refactor: Dockerfile only copy package*.json before installing dependencies
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.
2025-06-17 18:29:55 +02: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
LuBashQ
56c88e7d5f build: create multi-arch Docker images
Create multi-arch Docker images. Currently built platforms are:

* linux/amd64
* linux/arm64
* linux/arm/v7

Signed-off-by: LuBashQ <cristian.lupascu.nicolae@gmail.com>
2024-11-24 21:22:30 +01:00
Kingsley Yung
14b8d0fd64 feat: webdav integration
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.
2024-10-09 18:15:10 +02:00
Johannes Millan
adf7e3cfdc build: fix docker #3293 2024-07-26 08:52:03 +02:00
Johannes Millan
ac68d23f5b build: update dockerfile to node 20 2024-07-18 11:06:17 +02:00
blackberrypineapple
cebd200153 build: update node version in Dockerfile 2023-04-26 11:40:47 +02:00
Johannes Millan
2802e6978c build: update docker file to work with npm 2021-08-27 21:12:44 +02:00
Carsten Meyer
d702d7ed0f remove stale/commented chrome install 2021-03-21 18:34:26 +01:00
Carsten Meyer
6720298e77 removed origin workflows and new Docker build 2021-03-21 15:56:46 +01:00
Martien Oranje
3e91cd09bb
Allow port to be customized in dockerfile 2021-01-06 09:37:45 +01:00
Johannes Millan
3380b815ad chore: provide basic docker image #177 2019-06-08 23:19:46 +02:00