Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: move fs from /home/pelias to /code/pelias/api #1663

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

missinglink
Copy link
Member

this PR resolves pelias/docker#318

the issue was caused by the code from this repo being copied to /home/pelias instead of the /code/pelias/* directories as used by other repos.

as a result the /home/pelias directory was only readable by the pelias user (1000), resulting in any user not sharing the UID 1000 to not be able to access files in the directory:

docker compose run api bash
[+] Building 0.0s (0/0)                                           docker:desktop-linux
[+] Building 0.0s (0/0)                                           docker:desktop-linux

I have no name!@4887bd97493c:/home/pelias$ pwd
/home/pelias

I have no name!@4887bd97493c:/home/pelias$ ls -lah
ls: cannot open directory '.': Permission denied

after this change the files live in /code/pelias/api and can be accessed:

docker compose run api bash
[+] Building 0.0s (0/0)                                           docker:desktop-linux
[+] Building 0.0s (0/0)                                           docker:desktop-linux

I have no name!@2156dd85f3b4:/code/pelias/api$ pwd
/code/pelias/api

I have no name!@2156dd85f3b4:/code/pelias/api$ ls -lah
total 376K
drwxr-xr-x   1 pelias pelias 4.0K Nov 28 11:14 .
drwxr-xr-x   1 pelias pelias 4.0K Nov 28 11:14 ..
-rw-r--r--   1 root   root    935 Nov  1  2021 app.js
-rw-r--r--   1 root   root   2.7K Jun 17  2019 autocomplete.md
drwxr-xr-x   2 root   root   4.0K Nov 11  2021 bin
drwxr-xr-x   3 root   root   4.0K Jul  8  2022 controller
-rw-r--r--   1 root   root    394 Nov 28 11:10 Dockerfile
-rw-r--r--   1 root   root    677 Oct  4  2018 .dockerignore
drwxr-xr-x   3 root   root   4.0K Nov  1  2021 .github
-rw-r--r--   1 root   root     59 Nov  1  2021 .gitignore
drwxr-xr-x   2 root   root   4.0K Jul  8  2022 helper
-rw-r--r--   1 root   root    755 Jul  8  2022 index.js
-rw-r--r--   1 root   root     30 Oct  4  2018 .jshintignore
-rw-r--r--   1 root   root    364 Nov  1  2021 .jshintrc
-rw-r--r--   1 root   root   1.1K Oct  4  2018 LICENSE
drwxr-xr-x   2 root   root   4.0K Jun 20  2022 middleware
drwxr-xr-x 301 pelias pelias  12K Nov 28 11:15 node_modules
-rw-r--r--   1 root   root     19 Oct  4  2018 .npmrc
-rw-r--r--   1 root   root    35K Aug 16  2021 out.clone
-rw-r--r--   1 root   root    45K Aug 16  2021 out.docs
-rw-r--r--   1 root   root   2.2K Nov 22 17:24 package.json
-rw-r--r--   1 pelias pelias 143K Nov 28 11:15 package-lock.json
drwxr-xr-x   2 root   root   4.0K Jul  3  2020 parser
-rw-r--r--   1 root   root    760 Aug 16  2021 pelias.docker.json
-rw-r--r--   1 root   root    696 Nov  1  2018 pelias.edge.json
-rw-r--r--   1 root   root    768 Jun 17  2019 pelias.tunnel.json
drwxr-xr-x   2 root   root   4.0K Feb  2  2022 public
drwxr-xr-x   3 root   root   4.0K May 10  2022 query
-rw-r--r--   1 root   root    14K Jul  8  2022 README.md
drwxr-xr-x   2 root   root   4.0K Nov 22 17:24 routes
drwxr-xr-x   2 root   root   4.0K Nov  7  2022 sanitizer
-rw-r--r--   1 root   root   2.5K Nov  1  2021 schema.js
drwxr-xr-x   3 root   root   4.0K Nov  1  2021 service
drwxr-xr-x   4 root   root   4.0K Nov  1  2021 test

I also tested and ./bin/start can be executed successfully.

Copy link
Member

@orangejulius orangejulius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh very nice catch, it does feel like this should resolve those permission errors!

@missinglink missinglink merged commit 9a0e94f into master Nov 28, 2023
6 checks passed
@missinglink missinglink deleted the docker-root branch November 28, 2023 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pelias_api stopped running, exit code 126
2 participants