Skip to content
This repository was archived by the owner on Apr 4, 2026. It is now read-only.

Commit f6367f8

Browse files
committed
251221
1 parent a4eaa94 commit f6367f8

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,32 @@ curl -fsSL https://get.pnpm.io/install.sh | sh -
2121
pnpm install
2222
```
2323

24+
## Podman Compose
25+
26+
### 构建
27+
28+
先构建镜像(只需要一次,或代码变动时重建)
29+
30+
```sh
31+
podman build -t cf-workers-dev .
32+
```
33+
34+
### 常用命令
35+
36+
```sh
37+
# 第一次启动(会自动构建镜像)
38+
podman-compose up -d
39+
40+
# 停止
41+
podman-compose down
42+
43+
# 查看日志
44+
podman-compose logs -f
45+
46+
# 重启(代码改动后一般不需要重建,只需重启容器)
47+
podman-compose restart workers
48+
```
49+
2450
### Windows
2551

2652
```sh

compose.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
services:
2+
workers:
3+
image: cf-workers-dev:latest
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
container_name: cf-workers-dev
8+
ports:
9+
- "8787:8787" # 本地访问 Workers 预览
10+
- "8976:8976" # 可选:Wrangler 的 dashboard(如果用了 --inspect)
11+
volumes:
12+
- .:/app # 代码实时挂载,改动无需重启
13+
- podman-node-modules:/app/node_modules # 持久化 node_modules,避免重复安装
14+
command:
15+
["npx", "wrangler", "dev", "--local", "--ip", "0.0.0.0", "--port", "8787"]
16+
restart: unless-stopped
17+
18+
volumes:
19+
podman-node-modules:

0 commit comments

Comments
 (0)