Docker improvements

- Create run-onionr-node.sh to parse env and supply args to run-onionr-node.py
- Dockerfile:
  - Run onionr by default rather than bash
  - Run as unprivileged user by default instead of root
  - Use /app for all code
  - Specify python 3.7 (3.8 fails to build cffi)
  - Use apt-get rather than apt (apt's CLI is not stable)
  - Slight reformatting and consolidation
This commit is contained in:
Duncan X Simpson 2020-12-14 23:20:27 -07:00
parent 9345d27d6a
commit 2dc11303d7
3 changed files with 58 additions and 3 deletions

View file

@ -1,12 +1,12 @@
FROM python:3.7
EXPOSE 8080
USER root
RUN mkdir /app
WORKDIR /app
ENV PORT=8080
EXPOSE 8080
ENV ONIONR_DOCKER=true
#Install needed packages
RUN apt-get update && apt-get install -y tor locales
@ -26,5 +26,6 @@ VOLUME /app/data/
#Default to running as nonprivileged user
RUN chmod g=u -R /app
USER 1000
ENV HOME=/app
CMD ["bash", "./onionr.sh"]
CMD ["bash", "./run-onionr-node.sh"]