-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
194 lines (193 loc) · 5.86 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
194 lines (193 loc) · 5.86 KB
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
services:
mongodb:
image: mongo:8
container_name: hyac_mongodb
hostname: mongodb
restart: unless-stopped
command: ["mongod", "--replSet", "rs0", "--bind_ip_all"]
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
networks:
- hyac_network
healthcheck:
test: |
mongosh --host localhost --port 27017 \
--eval "try { rs.status(); } catch (e) { rs.initiate({_id:'rs0', members:[{_id:0, host:'mongodb:27017'}]}); }; db.adminCommand({ ping: 1 }).ok ? quit(0) : quit(1)"
interval: 5s
timeout: 10s
retries: 20
start_period: 15s
rustfs:
image: rustfs/rustfs:latest
container_name: hyac_rustfs
restart: unless-stopped
command: ["/data"]
ports:
- 9000:9000
- 9001:9001
environment:
RUSTFS_ACCESS_KEY: ${S3_ACCESS_KEY}
RUSTFS_SECRET_KEY: ${S3_SECRET_KEY}
RUSTFS_ADDRESS: "0.0.0.0:9000"
RUSTFS_CONSOLE_ADDRESS: "0.0.0.0:9001"
RUSTFS_CONSOLE_ENABLE: "true"
volumes:
- /etc/localtime:/etc/localtime:ro
- rustfs_data:/data
networks:
- hyac_network
healthcheck:
test:
[
"CMD-SHELL",
"status=$$(curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:9000/); test \"$$status\" = \"403\" -o \"$$status\" = \"200\"",
]
interval: 5s
timeout: 10s
retries: 10
start_period: 10s
labels:
- "traefik.enable=true"
- "traefik.http.routers.hyac-rustfs.rule=Host(`oss.${DOMAIN_NAME}`)"
- "traefik.http.routers.hyac-rustfs.entrypoints=websecure"
- "traefik.http.routers.hyac-rustfs.tls=true"
- "traefik.http.services.hyac-rustfs.loadbalancer.server.port=9000"
- "traefik.http.services.hyac-rustfs.loadbalancer.passhostheader=true"
traefik:
image: "traefik:latest"
container_name: "hyac_traefik"
restart: unless-stopped
command:
- "--api.insecure=true"
- "--api.dashboard=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--providers.file.directory=/etc/traefik/dynamic"
- "--providers.file.watch=true"
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./traefik/dynamic-dev:/etc/traefik/dynamic"
- "./traefik/certs:/etc/traefik/certs:ro"
networks:
- hyac_network
server:
build:
context: ./server
target: development
image: hyac_server:dev
container_name: hyac_server
restart: unless-stopped
environment:
DOMAIN_NAME: ${DOMAIN_NAME}
EMAIL_ADDRESS: ${EMAIL_ADDRESS}
MONGODB_USERNAME: ""
MONGODB_PASSWORD: ""
S3_ACCESS_KEY: ${S3_ACCESS_KEY}
S3_SECRET_KEY: ${S3_SECRET_KEY}
S3_INTERNAL_ENDPOINT: ${S3_INTERNAL_ENDPOINT:-rustfs:9000}
S3_EXTERNAL_ENDPOINT: ${S3_EXTERNAL_ENDPOINT:-oss.${DOMAIN_NAME}}
S3_SECURE_INTERNAL: ${S3_SECURE_INTERNAL:-false}
S3_SECURE_EXTERNAL: ${S3_SECURE_EXTERNAL:-true}
S3_PUBLIC_BASE_URL: ${S3_PUBLIC_BASE_URL:-https://oss.${DOMAIN_NAME}}
S3_REGION: ${S3_REGION:-us-east-1}
SECRET_KEY: ${SECRET_KEY}
DEV_MODE: "true"
APP_CODE_PATH_ON_HOST: ${APP_CODE_PATH_ON_HOST}
DEMO_MODE: "false"
LSP_MODE: ${LSP_MODE:-sidecar}
LSP_SIDECAR_URL: ${LSP_SIDECAR_URL:-ws://hyac_lsp_sidecar:9002/lsp}
LSP_SIDECAR_TIMEOUT_SECONDS: ${LSP_SIDECAR_TIMEOUT_SECONDS:-10}
LSP_SIDECAR_FALLBACK_LEGACY: ${LSP_SIDECAR_FALLBACK_LEGACY:-true}
ports:
- 8000:8000
depends_on:
mongodb:
condition: service_healthy
rustfs:
condition: service_healthy
volumes:
- /etc/localtime:/etc/localtime:ro
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik/dynamic-dev:/traefik/dynamic
- ./server:/server
- ./app:/app
networks:
- hyac_network
healthcheck:
test: ["CMD", "python", "/server/healthcheck.py"]
interval: 5s
timeout: 10s
retries: 10
start_period: 10s
labels:
- "traefik.enable=true"
- "traefik.http.routers.hyac-server.rule=Host(`server.${DOMAIN_NAME}`)"
- "traefik.http.routers.hyac-server.entrypoints=websecure"
- "traefik.http.routers.hyac-server.tls=true"
- "traefik.http.services.hyac-server.loadbalancer.server.port=8000"
web:
build:
context: ./web
dockerfile: Dockerfile.dev # We will create this Dockerfile next
image: hyac_web:dev
container_name: hyac_web
restart: unless-stopped
depends_on:
server:
condition: service_healthy
ports:
- "9527:9527"
volumes:
- ./web:/app
- /app/node_modules
networks:
- hyac_network
labels:
- "traefik.enable=true"
- "traefik.http.routers.hyac-web.rule=Host(`console.${DOMAIN_NAME}`)"
- "traefik.http.routers.hyac-web.entrypoints=websecure"
- "traefik.http.routers.hyac-web.tls=true"
- "traefik.http.services.hyac-web.loadbalancer.server.port=9527"
- "traefik.http.services.hyac-web.loadbalancer.passhostheader=true"
app:
build:
context: ./app
target: development
image: hyac_app:dev
command: ["echo", "Hyac App image built. This container does not need to run."]
restart: "no"
networks:
- hyac_network
lsp-sidecar:
build:
context: ./app
target: development
image: hyac_lsp_sidecar:dev
container_name: hyac_lsp_sidecar
restart: unless-stopped
depends_on:
server:
condition: service_healthy
command: ["uvicorn", "lsp_sidecar.main:app", "--host", "0.0.0.0", "--port", "9002", "--reload"]
ports:
- "9002:9002"
volumes:
- ./app:/app
networks:
- hyac_network
networks:
hyac_network:
driver: bridge
volumes:
mongodb_data:
driver: local
rustfs_data:
driver: local