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

Feat: add Dockerfile and instructions on using Docker #78

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

zealot128
Copy link
Contributor

Added a Dockerfile + instructions, because I don't have any Python setup and always struggle with versions, Python version, Setup/Pyenv etc.pp.

This way, it makes it self contained and very simple and reproducible to run, especially if I already use Docker to run many software from the Internet :)

If you don't want to merge it, that's fine, too! Maybe other Docker users can find this PR then.

Thanks for the work, otherwise I might have killed a couple of weeks making my own in Rails ;)

@martin-ueding martin-ueding merged commit b55bbf0 into martin-ueding:master Jan 3, 2024
@martin-ueding
Copy link
Owner

Docker is a nice idea. I've smoothed out some of the things in the documentation.

One issue likely is write access to the files outside, I think there needs to be done something. Or you create all these files as root?

@zealot128
Copy link
Contributor Author

Yes you are right, it might be better to add a USER app or similar to the Dockerfile.

In my case it was not needed, as the Macos Docker runner runs as the user, so the data/* files are owned by my running user.

But this seems to do the trick:

 RUN mkdir /data

+ARG UID=1000
+
+RUN useradd -m -u $UID -d /app app && \
+    chown -R app:app /app && \
+    chown -R app:app /data
+
+USER $UID
+
 EXPOSE 5000

and than building with:

docker build --build-arg UID=`id -u`  -t geo-activity-playground  .

That way, the app-user matches the user that should run the docker container.

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.

None yet

2 participants