-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose-main.yml
129 lines (122 loc) · 4.02 KB
/
docker-compose-main.yml
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
version: "3.7"
services:
terra: &terra
build: &terra_build
context: .
dockerfile: docker/terra.Dockerfile
# prevent different users from clobbering each others images
image: ${TERRA_DOCKER_REPO}:terra_${TERRA_USERNAME}
environment: &terra_environment
# Variables for docker_entrypoint.bsh
DOCKER_UID: ${TERRA_UID}
DOCKER_GIDS: ${TERRA_GIDS}
DOCKER_GROUP_NAMES: ${TERRA_GROUP_NAMES}
DOCKER_USERNAME: user
JUSTFILE: ${TERRA_TERRA_DIR_DOCKER}/docker/terra.Justfile
JUST_SETTINGS: ${TERRA_TERRA_DIR_DOCKER}/terra.env
PYTHONPATH: ${TERRA_PYTHONPATH-}
DISPLAY:
TZ:
cap_add:
- SYS_PTRACE # Useful for gdb
volumes:
# terra source code
- &terra_source_volume
type: ${TERRA_TERRA_DIR_TYPE}
source: ${TERRA_TERRA_DIR}
target: ${TERRA_TERRA_DIR_DOCKER}
read_only: true
# vsi_common
- &terra_vsi_volume
type: ${TERRA_TERRA_DIR_TYPE}
source: ${TERRA_TERRA_DIR}/external/vsi_common
target: /vsi
read_only: true
# The storage location of the pipenv virtualenv and venv cache
- &terra_venv_volume
type: volume
source: terra-venv
target: /venv
secrets:
- source: redis_secret
target: ${TERRA_REDIS_SECRET}
terra-demo:
<<: *terra
environment:
<<: *terra_environment
TERRA_SETTINGS_FILE:
redis-commander:
image: rediscommander/redis-commander
ports:
- "${TERRA_REDIS_COMMANDER_PORT}:${TERRA_REDIS_COMMANDER_PORT_DOCKER}"
secrets:
- source: redis_secret
target: ${TERRA_REDIS_SECRET}
- source: redis_commander_secret
target: ${TERRA_REDIS_COMMANDER_SECRET}
command: |
sh -c '
echo -n '"'"'{
"connections":[
{
"password": "'"'"' > /redis-commander/config/local-production.json
cat "${TERRA_REDIS_SECRET_FILE_DOCKER}" | sed '"'"'s|\\|\\\\|g;s|"|\\"|g'"'"' >> /redis-commander/config/local-production.json
echo -n '"'"'",
"host": "${TERRA_REDIS_HOSTNAME_DOCKER}",
"label": "terra",
"dbIndex": 0,
"connectionName": "redis-commander",
"port": "${TERRA_REDIS_PORT_DOCKER}"
}
],
"server": {
"address": "0.0.0.0",
"port": "${TERRA_REDIS_COMMANDER_PORT_DOCKER}",
"httpAuth": {
"username": "admin",
"passwordHash": "'"'"'>> /redis-commander/config/local-production.json
cat "${TERRA_REDIS_COMMANDER_SECRET_FILE_DOCKER}" | sed '"'"'s|\\|\\\\|g;s|"|\\"|g'"'"' >> /redis-commander/config/local-production.json
echo '"'"'"
}
}
}'"'"' >> /redis-commander/config/local-production.json
/redis-commander/docker/entrypoint.sh'
# " Fix vscode syntax highlighting error
terra_pipenv:
<<: *terra
build:
<<: *terra_build
target: pipenv_run
image: ${TERRA_DOCKER_REPO}:terra_pipenv_${TERRA_USERNAME}
volumes:
- <<: *terra_source_volume
# egg-info directory will need to be writable
read_only: false
- <<: *terra_vsi_volume
read_only: false
- <<: *terra_venv_volume
test:
<<: *terra
volumes:
- <<: *terra_source_volume
read_only: false
- *terra_venv_volume
- *terra_vsi_volume
ipykernel:
<<: *terra
ports:
- "${JUPYTER_CONTROL_PORT_HOST-10001}:${JUPYTER_CONTROL_PORT-10001}"
- "${JUPYTER_HB_PORT_HOST-10002}:${JUPYTER_HB_PORT-10002}"
- "${JUPYTER_IOPUB_PORT_HOST-10003}:${JUPYTER_IOPUB_PORT-10003}"
- "${JUPYTER_SHELL_PORT_HOST-10004}:${JUPYTER_SHELL_PORT-10004}"
- "${JUPYTER_STDIN_PORT_HOST-10005}:${JUPYTER_STDIN_PORT-10005}"
secrets:
redis_secret:
file: ${TERRA_REDIS_SECRET_FILE}
redis_commander_secret:
file: ${TERRA_REDIS_COMMANDER_SECRET_FILE}
volumes:
terra-venv:
labels:
com.vsi.just.clean_action: delete
com.vsi.just.clean_setup: terra run-nopipenv true