-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathDockerfile
44 lines (33 loc) · 842 Bytes
/
Dockerfile
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
44
#
# Install python packages (and build tools)
#
FROM python:3.9 as builder
RUN mkdir /app
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get install gcc g++ curl -y \
&& apt-get clean
RUN pip install --upgrade pip
COPY ./requirements.txt /app/requirements.txt
RUN pip install --user -r requirements.txt
#
# Copy built python packages to the new image.
#
FROM python:3.9 as app
RUN mkdir /app
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV DEBIAN_FRONTEND noninteractive
ENV SLEEP_TIMER="120"
ENV SLEEP_TIMER_MINOR="15"
ENV SLEEP_RANDOMIZER="20"
ENV STORAGE_FOLDER="/storage"
VOLUME /storage
COPY --from=builder /root/.local /root/.local
COPY ./src /app/src
COPY ./bin /app/bin
CMD [ "python3", "-m", "bin.mining.run"]