Skip to content

Commit 647aefc

Browse files
committed
Add .env-dist file and update README to reference it; parameterize PUID and PGID in docker-compose
1 parent 4f26bdb commit 647aefc

File tree

3 files changed

+95
-4
lines changed

3 files changed

+95
-4
lines changed

.env-dist

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
###############################################################################
2+
######### Credentials, see credentials section for more details
3+
######### https://github.com/gnzsnz/ib-gateway-docker?tab=readme-ov-file#credentials
4+
#########
5+
######### To start update TWS_USERID and TWS_PASSWORD, everything is ready
6+
######### to start in paper mode with default VNC password, see VNC_SERVER_PASSWORD
7+
###############################################################################
8+
TWS_USERID=myTwsAccountName
9+
TWS_PASSWORD=myTwsPassword
10+
# for credentials
11+
# TWS_PASSWORD_FILE=
12+
# for parallel execution, live and paper simultaneourly
13+
# TWS_USERID_PAPER=
14+
# TWS_PASSWORD_PAPER=
15+
# TWS_PASSWORD_PAPER_FILE=
16+
# TWS rdesktop password
17+
# PASSWD=abc
18+
# PASSWD_FILE=
19+
# TWS rdesktop UID and GID
20+
# PUID=1000
21+
# PGID=1000
22+
# other options, Etc/UTC, Europe/Paris, America/New_York, Asia/Tokyo
23+
TIME_ZONE=Europe/Zurich
24+
###############################################################################
25+
######### Settings path and custom config, see documentation
26+
######### https://github.com/gnzsnz/ib-gateway-docker?tab=readme-ov-file#preserve-settings-across-containers
27+
###############################################################################
28+
# ib-gateway
29+
# TWS_SETTINGS_PATH=/home/ibgateway/Jts
30+
# tws
31+
# TWS_SETTINGS_PATH=/config/tws_settings
32+
TWS_SETTINGS_PATH=
33+
# if you need custom config
34+
# https://github.com/gnzsnz/ib-gateway-docker?tab=readme-ov-file#customizing-the-image
35+
# CUSTOM_CONFIG=
36+
###############################################################################
37+
######### Java memory settings, see
38+
######### https://www.ibkrguides.com/traderworkstation/increase-tws-memory-size.htm
39+
###############################################################################
40+
# JAVA_HEAP_SIZE=1024
41+
###############################################################################
42+
######### IBC settings
43+
######### these are IBC settings passed to IBC's config.ini file
44+
######### for reference please visit
45+
######### https://github.com/IbcAlpha/IBC/blob/master/userguide.md
46+
###############################################################################
47+
# trading mode can be live,paper,both - both allows for parallel live and paper
48+
TRADING_MODE=paper
49+
READ_ONLY_API=no
50+
TWOFA_TIMEOUT_ACTION=restart
51+
TWOFA_EXIT_INTERVAL=
52+
TWOFA_DEVICE=
53+
BYPASS_WARNING=
54+
AUTO_RESTART_TIME=11:59 PM
55+
AUTO_LOGOFF_TIME=
56+
TWS_COLD_RESTART=
57+
TWS_ACCEPT_INCOMING=
58+
SAVE_TWS_SETTINGS=
59+
RELOGIN_AFTER_TWOFA_TIMEOUT=yes
60+
EXISTING_SESSION_DETECTED_ACTION=primary
61+
ALLOW_BLIND_TRADING=no
62+
#TWS_MASTER_CLIENT_ID=
63+
###############################################################################
64+
######### VNC settings
65+
###############################################################################
66+
VNC_SERVER_PASSWORD=myVncPassword
67+
# see credentials section for more details
68+
# VNC_SERVER_PASSWORD_FILE
69+
###############################################################################
70+
######### SSH tunnel settings, see documentation
71+
######### https://github.com/gnzsnz/ib-gateway-docker?tab=readme-ov-file#ssh-tunnel
72+
###############################################################################
73+
SSH_TUNNEL=
74+
SSH_OPTIONS=
75+
SSH_ALIVE_INTERVAL=
76+
SSH_ALIVE_COUNT=
77+
SSH_PASSPHRASE=
78+
SSH_PASSPHRASE_FILE=
79+
SSH_REMOTE_PORT=
80+
SSH_USER_TUNNEL=
81+
SSH_RESTART=
82+
SSH_VNC_PORT=
83+
SSH_RDP_PORT=
84+
###############################################################################
85+
######### Start scripts settings, see documentation
86+
######### https://github.com/gnzsnz/ib-gateway-docker?tab=readme-ov-file#start-up-scripts
87+
###############################################################################
88+
#START_SCRIPTS=init-scripts/start_scripts
89+
#X_SCRIPTS=init-scripts/x_scripts
90+
#IBC_SCRIPTS=init-scripts/ibc_scripts

template_README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ services:
112112

113113
```
114114

115-
Create an .env on root directory. Example .env file:
115+
Create an .env on root directory. You can use the provided [.env-dist](https://github.com/gnzsnz/ib-gateway-docker/blob/master/.env-dist) as a starting point. Example .env file:
116116

117117
```bash
118118
TWS_USERID=myTwsAccountName
@@ -164,7 +164,7 @@ Once `docker-compose.yml` and `.env` are in place you can start the container wi
164164
docker compose up
165165
```
166166

167-
To get a GUI can use vnc for ib-gateway or RDP for TWS.
167+
To get a GUI you can use vnc for ib-gateway or RDP for TWS.
168168

169169
Looking for help? Please keep reading below, or go to
170170
[discussion](https://github.com/gnzsnz/ib-gateway-docker/discussions) section for common
@@ -188,6 +188,7 @@ All environment variables are common between ibgateway and TWS image, unless spe
188188
| `VNC_SERVER_PASSWORD_FILE` | VNC server password. If not defined, then VNC server will NOT start. Specific to ibgateway, ignored by TWS. | **not defined** (VNC disabled) |
189189
| `TWOFA_TIMEOUT_ACTION` | 'exit' or 'restart', set to 'restart if you set `AUTO_RESTART_TIME`. See IBC [documentation](https://github.com/IbcAlpha/IBC/blob/master/userguide.md#second-factor-authentication) | exit |
190190
| `TWOFA_DEVICE` | second factor authentication device. See IBC [documentation](https://github.com/IbcAlpha/IBC/blob/c98d0bcc2ead9b8ab3900a23a707f01f8fd7dfbc/resources/config.ini#L104) | **not defined** |
191+
| `TWOFA_EXIT_INTERVAL` | It controls how long (in seconds) IBC waits for login to complete after the user acknowledges the second factor authentication. See [IBC documentation](https://github.com/IbcAlpha/IBC/blob/38593af5193ccd634aa226cc66242adc8718b653/resources/config.ini#L147) | 60 seconds |
191192
| `BYPASS_WARNING` | Settings relate to the corresponding 'Precautions' checkboxes in the API section of the Global Configuration dialog. Accepted values `yes`, `no` if not set, the existing TWS/Gateway configuration is unchanged | **not defined** |
192193
| `AUTO_RESTART_TIME` | time to restart IB Gateway, does not require daily 2FA validation. format hh:mm AM/PM. See IBC [documentation](https://github.com/IbcAlpha/IBC/blob/master/userguide.md#ibc-user-guide) | **not defined** |
193194
| `AUTO_LOGOFF_TIME` | Auto-Logoff: at a specified time, TWS shuts down tidily, without restarting | **not defined** |

tws-docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ services:
1414
- "ghcr.io/gnzsnz/tws-rdesktop:latest"
1515
image: ghcr.io/gnzsnz/tws-rdesktop:latest
1616
environment:
17-
PUID: 1000
18-
PGID: 1000
17+
PUID: ${PUID:-1000}
18+
PGID: ${PGID:-1000}
1919
PASSWD: ${PASSWD:-}
2020
TWS_USERID: ${TWS_USERID}
2121
TWS_PASSWORD: ${TWS_PASSWORD}

0 commit comments

Comments
 (0)