cyclosm / cyclosm-cartocss-style

Cycle oriented CartoCSS style.
https://www.cyclosm.org
Other
241 stars 45 forks source link

Docker permission issue if owner is not 1000 #571

Closed abienvenu closed 3 years ago

abienvenu commented 3 years ago

Hello, Following the instructions in docs/DOCKER.md work like a charm if the owner of the cyclosm-cartocss-style directory is 1000. Otherwise (owner is user 1001), docker-compose up kosmtik will write the following alert :

Starting cyclosm-cartocss-style_kosmtik_1 ... done
Attaching to cyclosm-cartocss-style_kosmtik_1
kosmtik_1  | Waiting for PostgreSQL to be running
kosmtik_1  | PostgreSQL running
kosmtik_1  | cp: cannot create regular file '.kosmtik-config.yml': Permission denied
kosmtik_1  | [Core] No usable config file found in .kosmtik-config.yml
kosmtik_1  | [Core] Loading plugin from ../plugins/base-exporters/index.js
kosmtik_1  | [Core] Loading plugin from ../plugins/hash/index.js
kosmtik_1  | [Core] Loading plugin from ../plugins/local-config/index.js
kosmtik_1  | [Core] Loading plugin from ../plugins/datasource-loader/index.js
kosmtik_1  | [Core] Loading project from project.mml
kosmtik_1  | [Core] PreviewServer started, you can browse http://0.0.0.0:6789

It will not create metatiles in tmp/cyclosm/meta, and will not download and install land polygons. When I access http://localhost:6789, I get a blank map, and kosmtik is taking 100% CPU forever.

Phyks commented 3 years ago

Does it work if you replace https://github.com/cyclosm/cyclosm-cartocss-style/blob/4fed093a5d8d3e2776b0c443d68555c5cfaa95b8/scripts/docker-startup.sh#L60-L64 by

  # Using default Kosmtik settings file
  export KOSMTIK_CONFIGPATH="/tmp/.kosmtik-config.yml" 

?

abienvenu commented 3 years ago

It helps with the initial error, but I still get the same issue : land polygons not downloaded, blank map, kosmtik taking 100% CPU forever.

The problem is that kosmtik is running with uid 1000, and docker-compose will mount current directory .:/cyclosm. If current directory does not belong to uid 1000, kosmtik get stuck.

This is a workaround : cd cyclosm-cartocss-style; chown 1000:1000 .

Phyks commented 3 years ago

Ok! I pushed an update to the docs.