Split compose build override from deploy config

This commit is contained in:
2026-06-25 18:46:17 +08:00
parent 4fbba07b27
commit bf6db8c455
3 changed files with 13 additions and 5 deletions

View File

@@ -26,10 +26,16 @@ mc-gateway 默认不依赖配置文件。直接启动后会在 `25565` 端口同
### Docker Compose ### Docker Compose
可以直接用 Docker Compose 本地构建并启动: 生产部署只需要 `compose.yaml`可以直接用 Docker Compose 拉取已发布镜像并启动:
```sh ```sh
docker compose up -d --build docker compose up -d
```
源码目录中包含 `compose.override.yaml`Docker Compose 会自动加载它,因此本地构建测试仍然可以直接运行:
```sh
docker compose build
``` ```
默认使用 host network在宿主机 `25565/tcp` 提供 Minecraft TCP 转发入口和后台管理入口,后台地址为: 默认使用 host network在宿主机 `25565/tcp` 提供 Minecraft TCP 转发入口和后台管理入口,后台地址为:

5
compose.override.yaml Normal file
View File

@@ -0,0 +1,5 @@
services:
mc-gateway:
build:
context: .
dockerfile: Dockerfile

View File

@@ -1,9 +1,6 @@
services: services:
mc-gateway: mc-gateway:
image: ${MC_GATEWAY_IMAGE:-ghcr.io/tursom/mc-gateway:latest} image: ${MC_GATEWAY_IMAGE:-ghcr.io/tursom/mc-gateway:latest}
build:
context: .
dockerfile: Dockerfile
network_mode: host network_mode: host
restart: unless-stopped restart: unless-stopped
environment: environment: