.env
# 数据库配置
DB_HOST=mysql / host.docker.internal
DB_PORT=3306
DB_USERNAME=root
DB_PASSWORD=your_strong_password_here
DB_DATABASE=wxlogin
# Redis配置
REDIS_HOST=redis
REDIS_PORT=6379
REDIS_PASSWORD=
# 微信公众号配置
WECHAT_APPID=your_wechat_appid
WECHAT_APPSECRET=your_wechat_appsecret
# 服务配置
PORT=3000
NODE_ENV=production
BASE_URL=https://yourdomain.com/api
# 管理员账号配置
ADMIN_USERNAME=admin
ADMIN_PASSWORD=your_admin_password
JWT_SECRET=your_jwt_secret_key_here
# 说明:
# 1. 请修改所有密码和密钥为强密码
# 2. JWT_SECRET 建议使用随机生成的长字符串
# 3. 微信配置需要在微信公众平台获取
# 4. 生产环境请务必修改默认密码
docker-compose.yml (依赖宿主机mysql+redis)
version: "3.8"
services:
wx-auth-server:
image: edk24/wx-auth-server:latest
container_name: wx-auth-server
ports:
- "3008:80"
volumes:
- ./.env:/app/.env
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"
docker-compose.yml(全docker)
version: "3.8"
services:
wx-auth-server:
image: edk24/wx-auth-server:latest
container_name: wx-auth-server
ports:
- "3008:80"
volumes:
- ./.env:/app/.env
restart: unless-stopped
depends_on:
- mysql
- redis
environment:
- DB_HOST=mysql
- DB_PORT=3306
- DB_USERNAME=root
- DB_PASSWORD=your_strong_password_here
- DB_DATABASE=wxlogin
- REDIS_HOST=redis
- REDIS_PORT=6379
networks:
- app-network
mysql:
image: mysql:5.7
container_name: wx-auth-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: your_strong_password_here
MYSQL_DATABASE: wxlogin
ports:
- "3306:3306" # 如果不需要外部访问,可以删掉
volumes:
- mysql-data:/var/lib/mysql
command: >
--default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
networks:
- app-network
redis:
image: redis:7-alpine
container_name: wx-auth-redis
restart: unless-stopped
volumes:
- redis-data:/data
command: redis-server --appendonly yes
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
mysql-data:
redis-data:
go
docker-compose pull
docker-compose up -d
Content type
Image
Digest
sha256:bf726f749…
Size
111.6 MB
Last updated
7 months ago
docker pull edk24/wx-auth-server