chore: change default port to 18800 and use relative paths in compose
Build and Push to GHCR / build-and-push (push) Has been cancelled
Build and Push to GHCR / build-and-push (push) Has been cancelled
- docker-compose.yml: port 18800:8080, relative volume paths - README.md: mkdir /opt/Mirror-Proxy && cd, then deploy
This commit is contained in:
@@ -40,10 +40,10 @@ LISTEN_ADDR=:9090 ./mirror-proxy
|
|||||||
**1. 创建 `docker-compose.yml`**
|
**1. 创建 `docker-compose.yml`**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 创建数据目录
|
# 1. 创建工作目录
|
||||||
mkdir -p /opt/mirror-proxy/config /opt/mirror-proxy/cache
|
mkdir -p /opt/Mirror-Proxy && cd /opt/Mirror-Proxy
|
||||||
|
|
||||||
# 创建 docker-compose.yml
|
# 2. 创建 docker-compose.yml
|
||||||
cat > docker-compose.yml << 'EOF'
|
cat > docker-compose.yml << 'EOF'
|
||||||
services:
|
services:
|
||||||
mirror-proxy:
|
mirror-proxy:
|
||||||
@@ -51,23 +51,20 @@ services:
|
|||||||
container_name: mirror-proxy
|
container_name: mirror-proxy
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "18800:8080"
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/mirror-proxy/config:/app/config
|
- ./config:/app/config
|
||||||
- /opt/mirror-proxy/cache:/app/cache
|
- ./cache:/app/cache
|
||||||
environment:
|
environment:
|
||||||
- TZ=Asia/Shanghai
|
- TZ=Asia/Shanghai
|
||||||
- CONFIG_PATH=/app/config/config.json
|
- CONFIG_PATH=/app/config/config.json
|
||||||
EOF
|
EOF
|
||||||
```
|
|
||||||
|
|
||||||
**2. 启动服务**
|
# 3. 启动服务
|
||||||
|
|
||||||
```bash
|
|
||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
首次启动会自动在 `/opt/mirror-proxy/config/` 目录下创建 `config.json`(默认账号 `admin` / `admin123`),无需手动提前创建配置文件。
|
首次启动会自动在 `./config/` 目录下创建 `config.json`(默认账号 `admin` / `admin123`),无需手动提前创建配置文件。
|
||||||
|
|
||||||
**3. 常用命令**
|
**3. 常用命令**
|
||||||
|
|
||||||
@@ -90,7 +87,7 @@ docker-compose pull && docker-compose up -d
|
|||||||
|
|
||||||
**4. 管理后台**
|
**4. 管理后台**
|
||||||
|
|
||||||
访问 `http://<服务器IP>:8080/admin/`,默认账号:
|
访问 `http://<服务器IP>:18800/admin/`,默认账号:
|
||||||
- 用户名:`admin`
|
- 用户名:`admin`
|
||||||
- 密码:`admin123`
|
- 密码:`admin123`
|
||||||
|
|
||||||
@@ -101,15 +98,16 @@ docker-compose pull && docker-compose up -d
|
|||||||
### 使用 Docker 直接运行
|
### 使用 Docker 直接运行
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 创建数据目录
|
# 创建工作目录并进入
|
||||||
mkdir -p /opt/mirror-proxy/config /opt/mirror-proxy/cache
|
mkdir -p /opt/Mirror-Proxy && cd /opt/Mirror-Proxy
|
||||||
|
mkdir -p config cache
|
||||||
|
|
||||||
# 拉取并运行(首次运行自动生成 config.json)
|
# 拉取并运行(首次运行自动生成 config.json)
|
||||||
docker run -d \
|
docker run -d \
|
||||||
--name mirror-proxy \
|
--name mirror-proxy \
|
||||||
-p 8080:8080 \
|
-p 18800:8080 \
|
||||||
-v /opt/mirror-proxy/config:/app/config \
|
-v $(pwd)/config:/app/config \
|
||||||
-v /opt/mirror-proxy/cache:/app/cache \
|
-v $(pwd)/cache:/app/cache \
|
||||||
-e CONFIG_PATH=/app/config/config.json \
|
-e CONFIG_PATH=/app/config/config.json \
|
||||||
--restart unless-stopped \
|
--restart unless-stopped \
|
||||||
ghcr.io/arkylin/mirror-proxy:latest
|
ghcr.io/arkylin/mirror-proxy:latest
|
||||||
|
|||||||
+3
-3
@@ -4,10 +4,10 @@ services:
|
|||||||
container_name: mirror-proxy
|
container_name: mirror-proxy
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "18800:8080"
|
||||||
volumes:
|
volumes:
|
||||||
- /opt/mirror-proxy/config:/app/config
|
- ./config:/app/config
|
||||||
- /opt/mirror-proxy/cache:/app/cache
|
- ./cache:/app/cache
|
||||||
environment:
|
environment:
|
||||||
- TZ=Asia/Shanghai
|
- TZ=Asia/Shanghai
|
||||||
- CONFIG_PATH=/app/config/config.json
|
- CONFIG_PATH=/app/config/config.json
|
||||||
|
|||||||
Reference in New Issue
Block a user