From 5fe21744e96d751ba419300a338c839970cb77bf Mon Sep 17 00:00:00 2001 From: caskd Date: Thu, 26 Dec 2019 19:21:17 +0100 Subject: [PATCH] External tor and temporary session settings --- .gitignore | 3 +-- build/Dockerfile | 16 ++++++++++++++++ zeronet.yml | 17 +++++++++++------ 3 files changed, 28 insertions(+), 8 deletions(-) create mode 100644 build/Dockerfile diff --git a/.gitignore b/.gitignore index 03e655e..c197ff0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -.*~ -certificates/ +users.json diff --git a/build/Dockerfile b/build/Dockerfile new file mode 100644 index 0000000..1380297 --- /dev/null +++ b/build/Dockerfile @@ -0,0 +1,16 @@ +FROM alpine:latest as fetcher + +WORKDIR /tmp +RUN apk add --no-cache --update curl tar ca-certificates +RUN curl -L https://github.com/HelloZeroNet/ZeroNet/archive/py3/ZeroNet-py3.tar.gz | tar xvpz + +# Switch to pypy after https://bitbucket.org/pypy/pypy/commits/e7f5d75f3f87 fix works in upstream +FROM python:latest +WORKDIR /app +RUN useradd -lM zeronet +COPY --from=fetcher /tmp/ZeroNet-py3/* ./ +RUN pip install -r requirements.txt + +EXPOSE 43110 +ENTRYPOINT ["python"] +CMD ["/app/zeronet.py"] diff --git a/zeronet.yml b/zeronet.yml index 8a03450..dc2491f 100644 --- a/zeronet.yml +++ b/zeronet.yml @@ -6,14 +6,19 @@ x-logging: &json-log max-size: 20m max-file: '5' -volumes: - data: +networks: + tor_backend: + external: true services: server: image: localhost:5000/zeronet + command: ["zeronet.py", "--tor", "always", "--tor-proxy", "tor_server:9050", "--ui-ip", "*"] deploy: replicas: 1 + resources: + limits: + memory: '500M' restart_policy: condition: any update_config: @@ -24,9 +29,9 @@ services: placement: constraints: [node.hostname == fra-n4] logging: *json-log - environment: - ENABLE_TOR: 'true' + networks: + - tor_backend ports: - '43110:43110' - volumes: - - 'data:/root/data' + tmpfs: + - '/app/data'