Last active
September 30, 2022 23:37
-
-
Save undermink/3a0aa709a6f8ece7a2a7e7a7a04add04 to your computer and use it in GitHub Desktop.
A simple dockerfile for running a maigc-wormhole-mailbox-server as a nonpriviilaged user (appuser). :)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.8 | |
# create a non root user to run the python stuff | |
RUN groupadd -g 999 appuser && \ | |
useradd -r -u 999 -g appuser appuser | |
# create a user homedir | |
RUN mkdir -p /home/appuser | |
# change ownership of homedir | |
RUN chown appuser:appuser /home/appuser -R | |
# become that user | |
USER appuser | |
# add /home/appuser/.local/bin to PATH | |
ENV PATH="${PATH}:/home/appuser/.local/bin" | |
# upgrade pip | |
RUN /usr/local/bin/python -m pip install --upgrade pip | |
# install the magic-wormhole-mailbox-server | |
RUN $HOME/.local/bin/pip install magic-wormhole-mailbox-server | |
# change the workdir | |
WORKDIR /home/appuser | |
# and run it :) | |
CMD [ "twist", "wormhole-mailbox","--usage-db=usage.sqlite" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment