Merge pull request #90 from prtngn/master

Fix dockerfile
This commit is contained in:
caryoscelus 2022-05-28 18:22:28 +04:00 committed by GitHub
commit f786fabaf9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 24 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
venv
Dockerfile*

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ __pycache__/
# Hidden files # Hidden files
.* .*
!.dockerignore
!/.github !/.github
!/.gitignore !/.gitignore
!/.travis.yml !/.travis.yml

View File

@ -1,33 +1,21 @@
FROM alpine:3.11 FROM python:3.10.4-alpine
#Base settings RUN apk --update --no-cache --no-progress add gcc libffi-dev musl-dev make tor openssl g++ \
ENV HOME /root
COPY requirements.txt /root/requirements.txt
#Install ZeroNet
RUN apk --update --no-cache --no-progress add python3 python3-dev gcc libffi-dev musl-dev make tor openssl \
&& pip3 install -r /root/requirements.txt \
&& apk del python3-dev gcc libffi-dev musl-dev make \
&& echo "ControlPort 9051" >> /etc/tor/torrc \ && echo "ControlPort 9051" >> /etc/tor/torrc \
&& echo "CookieAuthentication 1" >> /etc/tor/torrc && echo "CookieAuthentication 1" >> /etc/tor/torrc
RUN python3 -V \
&& python3 -m pip list \
&& tor --version \
&& openssl version
#Add Zeronet source WORKDIR /app
COPY . /root VOLUME /app/data
VOLUME /root/data COPY . .
RUN python3 -m venv venv \
&& source venv/bin/activate \
&& python3 -m pip install -r requirements.txt
#Control if Tor proxy is started
ENV ENABLE_TOR false ENV ENABLE_TOR false
WORKDIR /root CMD (! ${ENABLE_TOR} || tor&) \
&& source venv/bin/activate \
&& python3 zeronet.py --ui_ip "*" --fileserver_port 26552
#Set upstart command
CMD (! ${ENABLE_TOR} || tor&) && python3 zeronet.py --ui_ip 0.0.0.0 --fileserver_port 26552
#Expose ports
EXPOSE 43110 26552 EXPOSE 43110 26552