-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
215 lines (201 loc) · 6.56 KB
/
docker-compose.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# once docker compose is running, you can run the following commands to seed the database and run the rails console
# docker exec -it brisk-api-1 rails db:prepare db:seed
# this creates the correct api routes and user data (credentials etc)
# to run brisk against the services in this docker-compose file, you can run the following command:
# BRISK_NO_BASTION=true BRISK_CONFIG_WARNINGS=true BRISK_APITOKEN=AfzWBMS8oy BRISK_APIKEY=dYho0h93lNfD/u/P BRISK_DEV=true BRISK_APIENDPOINT=localhost:9001 brisk
# if you want to run a local version of brisk you can build that in core/brisk-cli (using the buidl-debug.sh script) and replace the brisk command with PATH_TO_THIS_REPO/core/brisk-cli/brisk-cli in the command above
# create a project in the current directory
# BRISK_NO_BASTION=true BRISK_CONFIG_WARNINGS=true BRISK_APITOKEN=AfzWBMS8oy BRISK_APIKEY=dYho0h93lNfD/u/P BRISK_DEV=true BRISK_APIENDPOINT=localhost:9001 brisk project init node
services:
super:
depends_on:
- api
- super-setup
build:
context: ./core
dockerfile: ../docker/super.Dockerfile
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- super-keys:/keys:rw
- super-app:/tmp/remote_dir:rw
init: true
ports:
- "50050:50050"
- "2222:2222"
environment:
BRISK_API: "api:9001"
MAX_WORKERS: 1
DEV: true
BRISK_DOMAIN_NAME: "brisktest.com"
BRISK_SUPER_PORT: "50050"
BRISK_USE_DOCKER_COMPOSE: true
BRISK_LOG_LEVEL: "debug"
SUPER_LOCAL_DIR: "/tmp/remote_dir/"
REMOTE_DIR: "/tmp/remote_dir/"
BRISK_PROJECT_RUN_TIMEOUT: "31m"
BRISK_COMMAND_TIMEOUT: "30m"
BRISK_RUNNER_COMMAND_TIMEOUT: "29m"
command: bash -c "rm -rf /tmp/remote_dir/* && rm -rf /tmp/.* && /app/super.bin"
sysctls:
- net.ipv4.tcp_keepalive_intvl=10
- net.ipv4.tcp_keepalive_probes=150
- net.ipv4.tcp_keepalive_time=10
super-ssh:
image: brisktest/brisk-ssh:latest
network_mode: "service:super"
volumes:
- super-keys:/home/brisk/.ssh:rw
- super-app:/tmp/remote_dir:rw
super-setup:
image: busybox:latest
volumes:
- super-keys:/keys:rw
- super-app:/tmp/remote_dir:rw
command: "chown -R 3434:3434 /var/ /tmp/remote_dir/ /keys/ && chmod -R +w /keys/ /var /tmp/remote_dir/ && rm -rf /tmp/remote_dir/* /keys/* /var/lib/bastion/* "
worker:
depends_on:
- api
- worker-setup
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- worker-keys:/keys
- worker-app:/tmp/remote_dir
init: true
deploy:
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 10
window: 120s
environment:
BRISK_API: "api:9001"
DEV: "true"
BRISK_USE_DOCKER_COMPOSE: "true"
BRISK_SELF_REGISTER: "true"
WORKER_IMAGE: "node-lts"
TINI_SUBREAPER: "true"
PUBLIC_KEY_FILE: "/keys/authorized_keys"
REMOTE_DIR: "/tmp/remote_dir/"
RUNNER_COMMAND_TIMEOUT: "30m"
platform: linux/amd64
build:
context: ./core
dockerfile: ../docker/worker-node-lts.Dockerfile
sysctls:
- net.ipv4.tcp_keepalive_intvl=10
- net.ipv4.tcp_keepalive_probes=150
- net.ipv4.tcp_keepalive_time=10
worker-ssh:
image: brisktest/brisk-ssh:latest
network_mode: "service:worker"
platform: linux/amd64
environment:
- PGID=3434
- PUID=3434
volumes:
- worker-keys:/home/brisk/.ssh
- worker-app:/tmp/remote_dir
worker-setup:
image: busybox:latest
volumes:
- worker-keys:/keys
- worker-app:/tmp/remote_dir
command: sh -c "chown -R 3434:3434 /var/ /tmp/remote_dir/ /keys/ && chmod -R +w /keys/ /var /tmp/remote_dir/ && rm -rf /tmp/remote_dir/* /keys/* /var/lib/bastion/* "
worker-rails:
depends_on:
- api
- worker-rails-setup
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- worker-keys:/keys
- worker-rails-app:/tmp/remote_dir
init: true
deploy:
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 10
window: 120s
environment:
BRISK_API: "api:9001"
DEV: "true"
BRISK_USE_DOCKER_COMPOSE: "true"
BRISK_SELF_REGISTER: "true"
WORKER_IMAGE: "rails"
TINI_SUBREAPER: "true"
PUBLIC_KEY_FILE: "/keys/authorized_keys"
REMOTE_DIR: "/tmp/remote_dir/"
RUNNER_COMMAND_TIMEOUT: "30m"
platform: linux/amd64
build:
context: ./core
dockerfile: ../docker/worker-rails.Dockerfile
sysctls:
- net.ipv4.tcp_keepalive_intvl=10
- net.ipv4.tcp_keepalive_probes=150
- net.ipv4.tcp_keepalive_time=10
worker-rails-ssh:
image: brisktest/brisk-ssh:latest
network_mode: "service:worker-rails"
platform: linux/amd64
environment:
- PGID=3434
- PUID=3434
volumes:
- worker-keys:/home/brisk/.ssh
- worker-rails-app:/tmp/remote_dir
worker-rails-setup:
image: busybox:latest
volumes:
- worker-keys:/keys
- worker-rails-app:/tmp/remote_dir
command: sh -c "chown -R 3434:3434 /var/ /tmp/remote_dir/ /keys/ && chmod -R +w /keys/ /var /tmp/remote_dir/ && rm -rf /tmp/remote_dir/* /keys/* /var/lib/bastion/* "
api:
# command: sudo service ssh start && go run server/main.go
environment:
SECRET_KEY_BASE: "mOFzSSaXnkca0KhgDKLP7Luj78ZuWXR2AjuTqwl7UInI9awbRdxhmQ=="
GRUF_PORT: "9001"
GRUF_HOST: "0.0.0.0"
RAILS_ENV: "development"
RAILS_LOG_TO_STDOUT: "true"
DATABASE_URL: "postgresql://root:password@postgres:5432/brisk_frontend_development"
RAILS_LOG_LEVEL: debug
RAILS_MAX_THREADS: 1
DB_POOL: 5
STATEMENT_TIMEOUT: 90s
BRISK_INSECURE: true
REDIS_URL: redis://redis:6379/0
DEV: "true"
build:
context: ./api
dockerfile: Dockerfile.dev
deploy:
restart_policy:
condition: on-failure
platform: linux/amd64
ports:
- "9001:9001"
command: bash -c "bundle exec rails db:prepare && bundle exec gruf"
redis:
image: redis:alpine
ports:
- "6379:6379"
postgres:
image: "postgres:16"
container_name: "postgres_dev"
ports:
- 5432:5432
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: password
POSTGRES_DB: my-database
volumes:
- postgresdata:/var/lib/postgresql/data
volumes:
postgresdata:
driver: local
super-keys:
worker-keys:
super-app:
worker-app:
worker-rails-app: