-
Notifications
You must be signed in to change notification settings - Fork 35
/
Dockerfile
46 lines (31 loc) · 1.1 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
# Builder
FROM ubuntu:latest AS builder
RUN apt-get update
RUN apt-get install -y unzip dos2unix wget
WORKDIR /root
RUN wget -q --progress=bar:force:noscroll --show-progress https://download2.interactivebrokers.com/installers/ibgateway/latest-standalone/ibgateway-latest-standalone-linux-x64.sh -O install-ibgateway.sh
RUN chmod a+x install-ibgateway.sh
RUN wget -q --progress=bar:force:noscroll --show-progress https://github.com/IbcAlpha/IBC/releases/download/3.8.2/IBCLinux-3.8.2.zip -O ibc.zip
RUN unzip ibc.zip -d /opt/ibc
RUN chmod a+x /opt/ibc/*.sh /opt/ibc/*/*.sh
COPY run.sh run.sh
RUN dos2unix run.sh
# Application
FROM ubuntu:latest
RUN apt-get update
RUN apt-get install -y x11vnc xvfb socat
WORKDIR /root
COPY --from=builder /root/install-ibgateway.sh install-ibgateway.sh
RUN yes n | ./install-ibgateway.sh
RUN mkdir .vnc
RUN x11vnc -storepasswd 1358 .vnc/passwd
COPY --from=builder /opt/ibc /opt/ibc
COPY --from=builder /root/run.sh run.sh
COPY ibc_config.ini ibc/config.ini
ENV DISPLAY :0
ENV TRADING_MODE paper
ENV TWS_PORT 4002
ENV VNC_PORT 5900
EXPOSE $TWS_PORT
EXPOSE $VNC_PORT
CMD ./run.sh