Fix dockerfile

This commit is contained in:
Maxim Portnyagin 2022-05-28 18:13:00 +04:00
parent 73e23aa1e3
commit bd6188eeb7
No known key found for this signature in database
GPG Key ID: 8F27C63672B69287
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
.*
!.dockerignore
!/.github
!/.gitignore
!/.travis.yml

View File

@ -1,33 +1,21 @@
FROM alpine:3.11
FROM python:3.10.4-alpine
#Base settings
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 \
RUN apk --update --no-cache --no-progress add gcc libffi-dev musl-dev make tor openssl g++ \
&& echo "ControlPort 9051" >> /etc/tor/torrc \
&& echo "CookieAuthentication 1" >> /etc/tor/torrc
RUN python3 -V \
&& python3 -m pip list \
&& tor --version \
&& openssl version
#Add Zeronet source
COPY . /root
VOLUME /root/data
WORKDIR /app
VOLUME /app/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
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