-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtradesetup.cnfg
57 lines (48 loc) · 1.46 KB
/
tradesetup.cnfg
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
51
52
53
54
55
56
57
Trading:
build: .
restart: always
stdin_open: true
tty: true
ports:
- "22"
FROM python:2.7
RUN mkdir -p /AquibTask
ADD ./requirements.txt /AquibTask/requirements.txt
WORKDIR /AquibTask
RUN pip install -r requirements.txt
RUN echo America/New_York | tee /etc/timezone && dpkg-reconfigure --frontend noninteractive tzdata
# ADD . /AquibTask
# ENV TERM screen-256color
# ENTRYPOINT ["./AquibTask.py"]
# CMD ["--strategy=balancer"]
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y supervisor openssh-server
RUN apt-get install -y screen
RUN mkdir /root/.ssh
ADD authorized_keys /root/.ssh/authorized_keys
RUN /bin/echo -e "#!/bin/bash\n\
# service ntp start\n\
sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config && sed -ri 's/#UsePAM no/UsePAM no/g' /etc/ssh/sshd_config\n\
service ssh start\n\
exec >/dev/tty 2>/dev/tty </dev/tty\n\
cd /AquibTask && screen -s /bin/bash -dmS AquibTask ./AquibTask.py --strategy=balancer\n\
" > /AquibTask/launch-AquibTask.sh
RUN chmod +x /AquibTask/launch-AquibTask.sh
# Setup supervisord
RUN /bin/echo -e "[supervisord]\n\
nodaemon=true\n\
\n\
[program:AquibTask]\n\
directory=/AquibTask\n\
user=root\n\
command=/AquibTask/launch-AquibTask.sh\n\
startsecs=0" > /etc/supervisor/conf.d/AquibTask.conf
# Add "screen -r" to .profile
RUN /bin/echo -e "\n\
cd /AquibTask\n\
screen -r\n\
" >> /root/.profile
ADD . /AquibTask
EXPOSE 22
CMD ["-n", "-c", "/etc/supervisor/conf.d/AquibTask.conf"]
ENTRYPOINT ["/usr/bin/supervisord"]