-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
40 lines (39 loc) · 889 Bytes
/
docker-compose.yml
File metadata and controls
40 lines (39 loc) · 889 Bytes
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
version: '3.8'
services:
gotty:
build: .
image: gotty:latest
container_name: gotty
ports:
- "8080:8080"
environment:
# 可以通过环境变量配置
- TZ=Asia/Shanghai
volumes:
# 持久化上传文件
- ./uploads:/app/uploads
# 如果需要挂载配置文件
# - ./config.txt:/app/config.txt:ro
restart: unless-stopped
# 资源限制
deploy:
resources:
limits:
cpus: '1'
memory: 512M
reservations:
cpus: '0.5'
memory: 256M
# 安全选项
security_opt:
- no-new-privileges:true
read_only: false
tmpfs:
- /tmp
# 健康检查
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/"]
interval: 30s
timeout: 3s
retries: 3
start_period: 5s