forked from robcarver17/pysystemtrade
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
50 lines (37 loc) · 1.14 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
44
45
46
47
48
49
50
# base image
FROM python:3.8.6
# update installer, install vi, less, cron
RUN apt-get update && \
apt-get install -y vim && \
apt-get install -y less && \
apt-get install -y cron
# update pip
RUN python -m pip install --upgrade pip
# define echos dir
RUN mkdir /usr/src/echos
# set working dir
WORKDIR /usr/src/pysystemtrade
# copy dependencies definition
COPY requirements.txt ./
# install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# copy whole project to image (except entries in .dockerignore)
COPY . .
# copy docker specific config
COPY private/private_docker_config_syno.yaml ./private/private_config.yaml
# setup cron
COPY examples/docker/crontab /etc/cron.d/sysjobs
RUN chmod 0644 /etc/cron.d/sysjobs
ENV PYTHONUNBUFFERED 1
# install project
RUN python setup.py develop
# setup env variables
ENV PYSYS_CODE /usr/src/pysystemtrade
ENV SCRIPT_PATH $PYSYS_CODE/sysproduction/linux/scripts
ENV ECHO_PATH=/usr/src/echos
# set up PATH
RUN echo 'export PATH="$SCRIPT_PATH:$PATH"' >> ~/.bashrc
RUN echo 'export PYTHONPATH="$SCRIPT_PATH:$PYTHONPATH"' >> ~/.bashrc
# keep the container running
CMD cron -f
#CMD tail -F /dev/null