forked from antequant/ib-gateway-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
59 lines (45 loc) · 1.33 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
51
52
53
54
55
56
57
58
59
# Builder
FROM ubuntu:22.04 AS builder
RUN apt-get update \
&& apt-get install -y \
unzip \
dos2unix \
wget \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /root
RUN wget -q --progress=bar:force:noscroll --show-progress \
https://download2.interactivebrokers.com/installers/tws/stable-standalone/tws-stable-standalone-linux-x64.sh \
-O install-ibgateway.sh \
&& chmod a+x install-ibgateway.sh
RUN wget -q --progress=bar:force:noscroll --show-progress \
https://github.com/IbcAlpha/IBC/releases/download/3.16.0/IBCLinux-3.16.0.zip \
-O ibc.zip \
&& unzip ibc.zip -d /opt/ibc \
&& chmod a+x /opt/ibc/*.sh /opt/ibc/*/*.sh
COPY run.sh run.sh
RUN dos2unix run.sh
# Application
FROM ubuntu:22.04
RUN apt-get update \
&& apt-get install -y \
x11vnc \
xvfb \
socat \
&& rm -rf /var/lib/apt/lists/*
RUN useradd -ms /bin/bash docker
WORKDIR /home/docker
USER docker
COPY --from=builder /root/install-ibgateway.sh install-ibgateway.sh
RUN printf "/home/docker/Jts/981\nn" | ./install-ibgateway.sh
RUN mkdir .vnc \
&& x11vnc -storepasswd password .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