forked from Drakkar-Software/OctoBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
43 lines (33 loc) · 1.48 KB
/
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
FROM python:3.8-slim-buster AS base
# requires git to install requirements with git+https
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential git gcc libffi-dev libssl-dev libxml2-dev libxslt1-dev libxslt-dev libjpeg62-turbo-dev zlib1g-dev \
&& python -m venv /opt/venv
# skip cryptography rust compilation (required for armv7 builds)
ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1
# Make sure we use the virtualenv:
ENV PATH="/opt/venv/bin:$PATH"
COPY . .
RUN pip install -U setuptools wheel pip>=20.0.0 \
&& pip install Cython==0.29.21 \
&& pip install --prefer-binary -r requirements.txt \
&& python setup.py install
FROM python:3.8-slim-buster
ARG TENTACLES_URL_TAG=""
ENV TENTACLES_URL_TAG=$TENTACLES_URL_TAG
WORKDIR /octobot
COPY --from=base /opt/venv /opt/venv
COPY octobot/config /octobot/octobot/config
COPY docker-entrypoint.sh docker-entrypoint.sh
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl libxslt-dev libxcb-xinput0 libjpeg62-turbo-dev zlib1g-dev libblas-dev liblapack-dev libatlas-base-dev libopenjp2-7 libtiff-dev \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s /opt/venv/bin/OctoBot OctoBot # Make sure we use the virtualenv \
&& chmod +x docker-entrypoint.sh
VOLUME /octobot/backtesting
VOLUME /octobot/logs
VOLUME /octobot/tentacles
VOLUME /octobot/user
EXPOSE 5001
HEALTHCHECK --interval=1m --timeout=30s --retries=3 CMD curl --fail http://localhost:5001 || exit 1
ENTRYPOINT ["./docker-entrypoint.sh"]