-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathdocker-compose.yaml
63 lines (60 loc) · 1.77 KB
/
docker-compose.yaml
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
services:
mysql8:
image: mysql:8
restart: unless-stopped
environment:
# 方法一:设置时区为上海
- TZ=Asia/Shanghai
# - SET_CONTAINER_TIMEZONE=true # 方法二: 设置时区为上海
# - CONTAINER_TIMEZONE=Asia/Shanghai # 方法二: 设置时区为上海
# mysql启动时自动创建数据库
- MYSQL_DATABASE=fuxiaochen
# 设置root账户密码
- MYSQL_ROOT_PASSWORD=123456
volumes:
- mysql8_data:/data/db
# 和本机共享网络,设置了host模式的网络,就不需要暴露端口了,因为是和主机共享了
# network_mode: 'host'
# 设置了host模式的网络,就不需要暴露端口了,因为是和主机共享了
ports:
- "3306:3306"
command: [
"mysqld",
# 设置字符编码
"--character-set-server=utf8mb4",
"--collation-server=utf8mb4_unicode_ci",
]
umami:
image: ghcr.io/umami-software/umami:postgresql-latest
ports:
- "3000:3000"
environment:
DATABASE_URL: postgresql://umami:umami@db:5432/umami
DATABASE_TYPE: postgresql
APP_SECRET: replace-me-with-a-random-string
depends_on:
db:
condition: service_healthy
restart: always
healthcheck:
test: ["CMD-SHELL", "curl http://localhost:3000/api/heartbeat"]
interval: 5s
timeout: 5s
retries: 5
db:
image: postgres:15-alpine
environment:
POSTGRES_DB: umami
POSTGRES_USER: umami
POSTGRES_PASSWORD: umami
volumes:
- umami_db_data:/var/lib/postgresql/data
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 5s
retries: 5
volumes:
mysql8_data:
umami_db_data: