dockerfile + db relocation
This commit is contained in:
38
README.md
38
README.md
@@ -1,2 +1,40 @@
|
||||
# whatsapp-bot
|
||||
|
||||
## 🐳 Docker Deployment (Server)
|
||||
|
||||
Build and run the central inventory server:
|
||||
|
||||
```bash
|
||||
# Build the image
|
||||
docker build -t go-bot:latest .
|
||||
|
||||
# Run the container (Map port 9090 and persist the database/cache)
|
||||
docker run -d \
|
||||
--name whatsapp-bot \
|
||||
-p 9090:9090 \
|
||||
-e OPENROUTER_API_KEY=your_key \
|
||||
-e WHATSAPP_PHONE_ID=your_id \
|
||||
-e WHATSAPP_TOKEN=your_token \
|
||||
-v $(pwd)/whatsapp-bot/data:/root/data:Z \
|
||||
--restart unless-stopped \
|
||||
go-bot:latest
|
||||
```
|
||||
|
||||
Or use this stack:
|
||||
```yml
|
||||
services:
|
||||
bot:
|
||||
image: go-bot:latest
|
||||
container_name: whatsapp-bot
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- OPENROUTER_API_KEY=your_api_key_here
|
||||
- WHATSAPP_PHONE_ID=your_phone_id_here
|
||||
- WHATSAPP_TOKEN=your_token_here
|
||||
volumes:
|
||||
# Map host data folder to the app's data path
|
||||
# The :Z is required for SELinux (Fedora/RHEL)
|
||||
- YOUR_PATH/whatsapp-bot/data:/root/data:Z
|
||||
ports:
|
||||
- "8080:9090"
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user