Update bot logic, Dockerfile and docker-compose.yml
This commit is contained in:
36
docker-compose.yml
Normal file
36
docker-compose.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
# PostgreSQL 数据库
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
container_name: gpt-team-db
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: teamhelper
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# Go Helper Bot
|
||||
bot:
|
||||
build: .
|
||||
container_name: gpt-team-bot
|
||||
restart: always
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
# 覆盖 .env 中的数据库连接串,指向 docker 内部的 db 服务
|
||||
DATABASE_URL: postgres://postgres:postgres@db:5432/teamhelper?sslmode=disable
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
Reference in New Issue
Block a user