-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
43 lines (41 loc) · 1.28 KB
/
Copy pathdocker-compose.yml
File metadata and controls
43 lines (41 loc) · 1.28 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
services:
astro-blog:
build:
context: .
dockerfile: Dockerfile
image: ${REGISTRY:-ghcr.io}/${REPO_OWNER:-vxwork}/${REPO_NAME:-astro-docker}:${IMAGE_TAG:-latest}
container_name: astro-blog
restart: unless-stopped
ports:
- "4321:4321" # External port 8080 -> Container port 4321
environment:
HOST: "0.0.0.0"
PORT: "4321"
NODE_ENV: "production"
ADMIN_USERNAME: "admin" # 可自行修改
ADMIN_PASSWORD: "your_secure_password_2026" # ← 这里改成你的强密码
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:4321/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
- astro-network
# Optional: Mount volume for persistent content (if needed)
volumes:
- ./content:/app/content # ← 动态添加 Markdown 文章的核心挂载
- ./data:/app/data
- ./public/uploads:/app/public/uploads # 图片持久化
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M
networks:
astro-network:
driver: bridge
# Note: Volumes removed as standalone Node.js server doesn't need nginx logs