Compare commits
2 Commits
7687686885
...
15cea49f2d
| Author | SHA1 | Date | |
|---|---|---|---|
| 15cea49f2d | |||
| dff9e7d7cd |
@@ -19,16 +19,17 @@ chmod +x deploy.sh
|
||||
|
||||
```bash
|
||||
# 构建
|
||||
docker build -t your-registry/chatroom:latest .
|
||||
docker build -t zhengdushi/chatroom:latest .
|
||||
|
||||
# 推送(示例:Docker Hub / 阿里云 ACR)
|
||||
docker push your-registry/chatroom:latest
|
||||
docker push zhengdushi/chatroom:latest
|
||||
```
|
||||
|
||||
### 2. 服务器拉取并部署
|
||||
|
||||
```bash
|
||||
./deploy.sh your-registry/chatroom:latest
|
||||
cd ~/chatroom
|
||||
docker compose pull app && docker compose up -d
|
||||
```
|
||||
|
||||
## 三、自动更新部署
|
||||
|
||||
@@ -14,7 +14,7 @@ func main() {
|
||||
rabbitmqURL := os.Getenv("RABBITMQ_URL")
|
||||
if rabbitmqURL == "" {
|
||||
rabbitmqURL = "amqp://guest:guest@localhost:5672/"
|
||||
}
|
||||
}
|
||||
rmq, err := rabbitmq.NewClient(rabbitmqURL)
|
||||
if err != nil {
|
||||
log.Fatalf("RabbitMQ 连接失败: %v", err)
|
||||
|
||||
@@ -11,6 +11,8 @@ services:
|
||||
- RABBITMQ_HOST=rabbitmq
|
||||
- RABBITMQ_USER=admin
|
||||
- RABBITMQ_PASS=1218Zhengyaqi # ← 请务必修改为你的密码!
|
||||
- RABBITMQ_URL=amqp://admin:1218Zhengyaqi@rabbitmq:5672/
|
||||
|
||||
depends_on:
|
||||
- rabbitmq
|
||||
restart: unless-stopped
|
||||
|
||||
Reference in New Issue
Block a user