This repository was archived by the owner on Sep 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (36 loc) · 1.28 KB
/
Dockerfile
File metadata and controls
43 lines (36 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM python:3.7-slim
ENV LC_ALL C.UTF-8
ENV PYTHONIOENCODING utf-8
ENV PYTHONUNBUFFERED true
ENV APP sia
ENV BASEDIR /srv/apps/$APP
ENV APPDIR $BASEDIR/app
ENV SIADIR $BASEDIR/sia
ENV DATADIR $BASEDIR/data
ENV PATH $SIADIR:$PATH
# Create initial dirs
RUN mkdir -p $APPDIR $SIADIR $DATADIR
WORKDIR $APPDIR
# Install system dependencies
ENV RUNTIME_PACKAGES socat wget ca-certificates unzip
RUN apt-get update && \
apt-get --no-install-recommends -y install $RUNTIME_PACKAGES && \
rm -rf /var/lib/apt/lists/*
# Install python dependencies
COPY pyproject.toml poetry.lock $APPDIR/
RUN python3 -m pip install --no-cache-dir --upgrade pip poetry && \
poetry install && \
poetry cache clear pypi --all
# Install Sia
ENV SIA_VERSION 1.4.6
ENV SIA_FOLDER_NAME $SIA_VERSION
ENV SIA_RELEASE https://sia.tech/releases/Sia-v${SIA_VERSION}-linux-amd64.zip
# ENV SIA_RELEASE https://pixeldrain.com/api/file/E9yryAb8?download
RUN wget --progress=bar:force:noscroll --show-progress -q $SIA_RELEASE -O $SIADIR/sia.zip && \
unzip -q $SIADIR/sia.zip -d $SIADIR && \
mv $SIADIR/Sia-v${SIA_FOLDER_NAME}-linux-amd64/* $SIADIR && \
rm -r $SIADIR/Sia-v${SIA_FOLDER_NAME}-linux-amd64 && \
rm $SIADIR/sia.zip
COPY __main__.py $APPDIR/
EXPOSE 8000
ENTRYPOINT ["poetry", "run", "python", "__main__.py"]