External tor and temporary session settings

This commit is contained in:
caskd 2019-12-26 19:21:17 +01:00
parent 5a08cbc89f
commit 5fe21744e9
No known key found for this signature in database
GPG Key ID: 79DB21404E300A27
3 changed files with 28 additions and 8 deletions

3
.gitignore vendored
View File

@ -1,2 +1 @@
.*~
certificates/
users.json

16
build/Dockerfile Normal file
View File

@ -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"]

View File

@ -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'