mirror of
https://github.com/nickrunning/wechat-selkies.git
synced 2026-05-09 00:24:09 +00:00
feat: extract docker-compose config to .env and update commands to docker compose
This commit is contained in:
14
.env.example
Normal file
14
.env.example
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# Ports
|
||||||
|
HTTP_PORT=3000
|
||||||
|
HTTPS_PORT=3001
|
||||||
|
|
||||||
|
# User/Group
|
||||||
|
PUID=1000
|
||||||
|
PGID=100
|
||||||
|
|
||||||
|
# Selkies Web UI
|
||||||
|
# CUSTOM_USER=
|
||||||
|
# PASSWORD=
|
||||||
|
|
||||||
|
# Shared Memory
|
||||||
|
SHM_SIZE=1gb
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
/config/
|
/config/
|
||||||
|
.env
|
||||||
57
README.md
57
README.md
@@ -68,7 +68,7 @@ docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickr
|
|||||||
在浏览器中访问:`https://localhost:3001` 或 `https://<服务器IP>:3001`
|
在浏览器中访问:`https://localhost:3001` 或 `https://<服务器IP>:3001`
|
||||||
> **注意:** 映射3000端口用于HTTP访问,3001端口用于HTTPS访问,建议使用HTTPS。
|
> **注意:** 映射3000端口用于HTTP访问,3001端口用于HTTPS访问,建议使用HTTPS。
|
||||||
|
|
||||||
### docker-compose 部署
|
### Docker Compose 部署
|
||||||
1. **创建项目目录并进入**
|
1. **创建项目目录并进入**
|
||||||
```bash
|
```bash
|
||||||
mkdir wechat-selkies
|
mkdir wechat-selkies
|
||||||
@@ -81,27 +81,43 @@ docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickr
|
|||||||
image: nickrunning/wechat-selkies:latest # or ghcr.io/nickrunning/wechat-selkies:latest
|
image: nickrunning/wechat-selkies:latest # or ghcr.io/nickrunning/wechat-selkies:latest
|
||||||
container_name: wechat-selkies
|
container_name: wechat-selkies
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000" # http port
|
- "${HTTP_PORT:-3000}:3000"
|
||||||
- "3001:3001" # https port
|
- "${HTTPS_PORT:-3001}:3001"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ./config:/config
|
- ./config:/config
|
||||||
devices:
|
devices:
|
||||||
- /dev/dri:/dev/dri # optional, for hardware acceleration
|
- /dev/dri:/dev/dri
|
||||||
environment:
|
environment:
|
||||||
- PUID=1000 # user ID, set according to your system
|
- PUID=${PUID:-1000}
|
||||||
- PGID=100 # group ID, set according to your system
|
- PGID=${PGID:-100}
|
||||||
- TZ=Asia/Shanghai # timezone, set according to your timezone
|
- TZ=Asia/Shanghai
|
||||||
- LC_ALL=zh_CN.UTF-8 # locale, set according to your needs
|
- LC_ALL=zh_CN.UTF-8
|
||||||
- AUTO_START_WECHAT=true # default is true
|
- AUTO_START_WECHAT=true
|
||||||
- AUTO_START_QQ=false # default is false
|
- AUTO_START_QQ=false
|
||||||
# - CUSTOM_USER=<Your Name> # recommended to set a custom user name
|
- CUSTOM_USER=${CUSTOM_USER:-}
|
||||||
# - PASSWORD=<Your Password> # recommended to set a password for selkies web ui
|
- PASSWORD=${PASSWORD:-}
|
||||||
shm_size: "1gb" # recommended, will improve performance
|
shm_size: "${SHM_SIZE:-1gb}"
|
||||||
```
|
```
|
||||||
3. **启动服务**
|
3. **创建 `.env` 文件(可选)**
|
||||||
|
|
||||||
|
复制 `.env.example` 并按需修改,未设置的变量将使用默认值:
|
||||||
```bash
|
```bash
|
||||||
docker-compose up -d
|
cp .env.example .env
|
||||||
|
```
|
||||||
|
`.env` 文件示例:
|
||||||
|
```env
|
||||||
|
HTTP_PORT=3000
|
||||||
|
HTTPS_PORT=3001
|
||||||
|
PUID=1000
|
||||||
|
PGID=100
|
||||||
|
# CUSTOM_USER=
|
||||||
|
# PASSWORD=
|
||||||
|
SHM_SIZE=1gb
|
||||||
|
```
|
||||||
|
4. **启动服务**
|
||||||
|
```bash
|
||||||
|
docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
### 源码部署
|
### 源码部署
|
||||||
@@ -114,7 +130,7 @@ docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickr
|
|||||||
|
|
||||||
2. **启动服务**
|
2. **启动服务**
|
||||||
```bash
|
```bash
|
||||||
docker-compose up -d
|
docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **访问微信**
|
3. **访问微信**
|
||||||
@@ -137,7 +153,7 @@ docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickr
|
|||||||
|
|
||||||
#### 环境变量配置
|
#### 环境变量配置
|
||||||
|
|
||||||
在 `docker-compose.yml` 中可以配置以下环境变量:
|
在 `docker-compose.yml` 中可以配置以下环境变量,支持通过 `.env` 文件覆盖带有 `${VAR:-default}` 的配置项:
|
||||||
|
|
||||||
| 变量名 | 默认值 | 说明 |
|
| 变量名 | 默认值 | 说明 |
|
||||||
|--------|--------|------|
|
|--------|--------|------|
|
||||||
@@ -190,6 +206,7 @@ devices:
|
|||||||
```
|
```
|
||||||
wechat-selkies/
|
wechat-selkies/
|
||||||
├── docker-compose.yml # Docker Compose 配置文件
|
├── docker-compose.yml # Docker Compose 配置文件
|
||||||
|
├── .env.example # 环境变量示例文件
|
||||||
├── Dockerfile # Docker 镜像构建文件
|
├── Dockerfile # Docker 镜像构建文件
|
||||||
├── LICENSE # License
|
├── LICENSE # License
|
||||||
├── README.md # 项目说明文档
|
├── README.md # 项目说明文档
|
||||||
@@ -208,10 +225,10 @@ wechat-selkies/
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 使用预构建镜像
|
# 使用预构建镜像
|
||||||
docker-compose pull && docker-compose up -d
|
docker compose pull && docker compose up -d
|
||||||
|
|
||||||
# 使用源码构建
|
# 使用源码构建
|
||||||
git pull && docker-compose up -d --build
|
git pull && docker compose up -d --build
|
||||||
```
|
```
|
||||||
|
|
||||||
> **注意:** 微信和QQ的安装包 URL 指向官方最新版本,重新构建镜像时会自动下载最新版。
|
> **注意:** 微信和QQ的安装包 URL 指向官方最新版本,重新构建镜像时会自动下载最新版。
|
||||||
@@ -226,7 +243,7 @@ git pull && docker-compose up -d --build
|
|||||||
|
|
||||||
查看容器运行日志:
|
查看容器运行日志:
|
||||||
```bash
|
```bash
|
||||||
docker-compose logs -f wechat-selkies
|
docker compose logs -f wechat-selkies
|
||||||
```
|
```
|
||||||
|
|
||||||
## 技术架构
|
## 技术架构
|
||||||
|
|||||||
57
README_en.md
57
README_en.md
@@ -66,7 +66,7 @@ docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickr
|
|||||||
Open in browser: `https://localhost:3001` or `https://<server-ip>:3001`
|
Open in browser: `https://localhost:3001` or `https://<server-ip>:3001`
|
||||||
> **Note**: 3001 port is for HTTPS access. If you need HTTP access, please map port 3000 as well.
|
> **Note**: 3001 port is for HTTPS access. If you need HTTP access, please map port 3000 as well.
|
||||||
|
|
||||||
### docker-compose Deployment
|
### Docker Compose Deployment
|
||||||
1. **Create project directory and navigate into it**
|
1. **Create project directory and navigate into it**
|
||||||
```bash
|
```bash
|
||||||
mkdir wechat-selkies
|
mkdir wechat-selkies
|
||||||
@@ -79,27 +79,43 @@ docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickr
|
|||||||
image: nickrunning/wechat-selkies:latest # or ghcr.io/nickrunning/wechat-selkies:latest
|
image: nickrunning/wechat-selkies:latest # or ghcr.io/nickrunning/wechat-selkies:latest
|
||||||
container_name: wechat-selkies
|
container_name: wechat-selkies
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000" # http port
|
- "${HTTP_PORT:-3000}:3000"
|
||||||
- "3001:3001" # https port
|
- "${HTTPS_PORT:-3001}:3001"
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ./config:/config
|
- ./config:/config
|
||||||
devices:
|
devices:
|
||||||
- /dev/dri:/dev/dri # optional, for hardware acceleration
|
- /dev/dri:/dev/dri
|
||||||
environment:
|
environment:
|
||||||
- PUID=1000 # user ID, set according to your system
|
- PUID=${PUID:-1000}
|
||||||
- PGID=100 # group ID, set according to your system
|
- PGID=${PGID:-100}
|
||||||
- TZ=Asia/Shanghai # timezone, set according to your timezone
|
- TZ=Asia/Shanghai
|
||||||
- LC_ALL=zh_CN.UTF-8 # locale, set according to your needs
|
- LC_ALL=zh_CN.UTF-8
|
||||||
- AUTO_START_WECHAT=true # default is true
|
- AUTO_START_WECHAT=true
|
||||||
- AUTO_START_QQ=false # default is false
|
- AUTO_START_QQ=false
|
||||||
# - CUSTOM_USER=<Your Name> # recommended to set a custom user name
|
- CUSTOM_USER=${CUSTOM_USER:-}
|
||||||
# - PASSWORD=<Your Password> # recommended to set a password for selkies web ui
|
- PASSWORD=${PASSWORD:-}
|
||||||
shm_size: "1gb" # recommended, will improve performance
|
shm_size: "${SHM_SIZE:-1gb}"
|
||||||
```
|
```
|
||||||
3. **Start the service**
|
3. **Create `.env` file (optional)**
|
||||||
|
|
||||||
|
Copy `.env.example` and modify as needed. Variables not set will use default values:
|
||||||
```bash
|
```bash
|
||||||
docker-compose up -d
|
cp .env.example .env
|
||||||
|
```
|
||||||
|
`.env` file example:
|
||||||
|
```env
|
||||||
|
HTTP_PORT=3000
|
||||||
|
HTTPS_PORT=3001
|
||||||
|
PUID=1000
|
||||||
|
PGID=100
|
||||||
|
# CUSTOM_USER=
|
||||||
|
# PASSWORD=
|
||||||
|
SHM_SIZE=1gb
|
||||||
|
```
|
||||||
|
4. **Start the service**
|
||||||
|
```bash
|
||||||
|
docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
### Source Code Deployment
|
### Source Code Deployment
|
||||||
@@ -112,7 +128,7 @@ docker run -it -p 3001:3001 -v ./config:/config --device /dev/dri:/dev/dri nickr
|
|||||||
|
|
||||||
2. **Start the service**
|
2. **Start the service**
|
||||||
```bash
|
```bash
|
||||||
docker-compose up -d
|
docker compose up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
3. **Access WeChat**
|
3. **Access WeChat**
|
||||||
@@ -135,7 +151,7 @@ This project supports pushing to both GitHub Container Registry and Docker Hub.
|
|||||||
|
|
||||||
#### Environment Variables
|
#### Environment Variables
|
||||||
|
|
||||||
Configure the following environment variables in `docker-compose.yml`:
|
Configure the following environment variables in `docker-compose.yml`. Variables with `${VAR:-default}` syntax can be overridden via a `.env` file:
|
||||||
|
|
||||||
| Variable | Default | Description |
|
| Variable | Default | Description |
|
||||||
|----------|---------|-------------|
|
|----------|---------|-------------|
|
||||||
@@ -188,6 +204,7 @@ devices:
|
|||||||
```
|
```
|
||||||
wechat-selkies/
|
wechat-selkies/
|
||||||
├── docker-compose.yml # Docker Compose configuration file
|
├── docker-compose.yml # Docker Compose configuration file
|
||||||
|
├── .env.example # Environment variables example file
|
||||||
├── Dockerfile # Docker image build file
|
├── Dockerfile # Docker image build file
|
||||||
├── LICENSE # License
|
├── LICENSE # License
|
||||||
├── README.md # Project documentation (Chinese)
|
├── README.md # Project documentation (Chinese)
|
||||||
@@ -207,10 +224,10 @@ When WeChat or QQ displays a "version outdated" message, simply pull the latest
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Using pre-built images
|
# Using pre-built images
|
||||||
docker-compose pull && docker-compose up -d
|
docker compose pull && docker compose up -d
|
||||||
|
|
||||||
# Using source code build
|
# Using source code build
|
||||||
git pull && docker-compose up -d --build
|
git pull && docker compose up -d --build
|
||||||
```
|
```
|
||||||
|
|
||||||
> **Note:** The WeChat and QQ download URLs point to the latest official versions. Rebuilding the image will automatically download the newest version.
|
> **Note:** The WeChat and QQ download URLs point to the latest official versions. Rebuilding the image will automatically download the newest version.
|
||||||
@@ -225,7 +242,7 @@ git pull && docker-compose up -d --build
|
|||||||
|
|
||||||
View container runtime logs:
|
View container runtime logs:
|
||||||
```bash
|
```bash
|
||||||
docker-compose logs -f wechat-selkies
|
docker compose logs -f wechat-selkies
|
||||||
```
|
```
|
||||||
|
|
||||||
## Technical Architecture
|
## Technical Architecture
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ services:
|
|||||||
devices:
|
devices:
|
||||||
- /dev/dri:/dev/dri # optional, for hardware acceleration
|
- /dev/dri:/dev/dri # optional, for hardware acceleration
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000" # http port
|
- "${HTTP_PORT:-3000}:3000" # http port
|
||||||
- "3001:3001" # https port
|
- "${HTTPS_PORT:-3001}:3001" # https port
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- PUID=1000 # set user id according to your system
|
- PUID=${PUID:-1000} # set user id according to your system
|
||||||
- PGID=100 # set group id according to your system
|
- PGID=${PGID:-100} # set group id according to your system
|
||||||
# - CUSTOM_USER=<Your Name> # recommended to set a custom user name
|
- CUSTOM_USER=${CUSTOM_USER:-} # recommended to set a custom user name
|
||||||
# - PASSWORD=<Your Password> # recommended to set a password for selkies web ui
|
- PASSWORD=${PASSWORD:-} # recommended to set a password for selkies web ui
|
||||||
shm_size: "1gb" # recommended, will improve performance
|
shm_size: "${SHM_SIZE:-1gb}" # recommended, will improve performance
|
||||||
|
|||||||
Reference in New Issue
Block a user