-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
86 lines (81 loc) · 2.2 KB
/
docker-compose.yml
File metadata and controls
86 lines (81 loc) · 2.2 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
version: '3.8'
services:
# PostgreSQL Database
db:
image: postgres:16-alpine
container_name: triterm-db
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-triterm}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-triterm_password}
POSTGRES_DB: ${POSTGRES_DB:-triterm}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- triterm-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-triterm}"]
interval: 10s
timeout: 5s
retries: 5
# Backend Server
server:
build:
context: .
dockerfile: server/Dockerfile
container_name: triterm-server
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
NODE_ENV: production
PORT: 3000
DATABASE_URL: postgresql://${POSTGRES_USER:-triterm}:${POSTGRES_PASSWORD:-triterm_password}@db:5432/${POSTGRES_DB:-triterm}
REQUIRE_AUTH: ${REQUIRE_AUTH:-false}
AUTH_TOKEN: ${AUTH_TOKEN:-}
MAX_TERMINALS: ${MAX_TERMINALS:-10}
RATE_LIMIT_MAX: ${RATE_LIMIT_MAX:-100}
RATE_LIMIT_WINDOW: ${RATE_LIMIT_WINDOW:-60000}
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-}
volumes:
- server_logs:/app/server/logs
- server_recordings:/app/server/recordings
networks:
- triterm-network
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"]
interval: 30s
timeout: 3s
retries: 3
start_period: 40s
# Frontend Client
client:
build:
context: .
dockerfile: client/Dockerfile
container_name: triterm-client
restart: unless-stopped
depends_on:
server:
condition: service_healthy
ports:
- "${CLIENT_PORT:-80}:80"
networks:
- triterm-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost/"]
interval: 30s
timeout: 3s
retries: 3
start_period: 5s
volumes:
postgres_data:
driver: local
server_logs:
driver: local
server_recordings:
driver: local
networks:
triterm-network:
driver: bridge