-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
106 lines (103 loc) · 2.7 KB
/
Copy pathdocker-compose.yml
File metadata and controls
106 lines (103 loc) · 2.7 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
services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: dev-ssh-server
restart: unless-stopped
ports:
- "5000:5000"
extra_hosts:
# Allow container to reach host machine services (e.g., local databases)
- "host.docker.internal:host-gateway"
environment:
- NODE_ENV=production
- PORT=5000
- DATABASE_PATH=/app/data/database.db
# These will be loaded from .env file or can be set here
- JWT_SECRET=${JWT_SECRET}
- SESSION_SECRET=${SESSION_SECRET}
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
- CORS_ORIGIN=${CORS_ORIGIN:-http://localhost:3000}
- REQUIRE_HTTPS=${REQUIRE_HTTPS:-false}
# Guacd connection for RDP/VNC
- GUACD_HOST=guacd
- GUACD_PORT=4822
depends_on:
- guacd
volumes:
# Persist database data
- ./data:/app/data
# Optional: mount custom .env file
# - ./.env:/app/.env:ro
networks:
- dev-ssh-network
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:5000/api/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Security options
security_opt:
- no-new-privileges:true
# Resource limits (adjust as needed)
deploy:
resources:
limits:
cpus: '2'
memory: 1G
reservations:
cpus: '0.5'
memory: 256M
frontend:
build:
context: .
dockerfile: Dockerfile.frontend.bun
container_name: dev-ssh-frontend
restart: unless-stopped
ports:
- "3000:3000"
environment:
- NODE_ENV=production
depends_on:
- app
networks:
- dev-ssh-network
healthcheck:
test: ["CMD", "bun", "-e", "fetch('http://localhost:3000').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
# Security options
security_opt:
- no-new-privileges:true
# Resource limits
deploy:
resources:
limits:
cpus: '1'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
# Guacamole daemon for RDP/VNC connections with full NLA support
guacd:
image: guacamole/guacd:latest
container_name: dev-ssh-guacd
restart: unless-stopped
networks:
- dev-ssh-network
# Expose guacd port to the app service
expose:
- "4822"
# Optional: mount for drive redirection
volumes:
- ./guacd-drive:/drive:rw
- ./guacd-record:/record:rw
environment:
- GUACD_LOG_LEVEL=info
networks:
dev-ssh-network:
driver: bridge