From de8c4340129fef3a4a26c1848b4316f9dacacbde Mon Sep 17 00:00:00 2001 From: purofle Date: Tue, 3 Jun 2025 01:51:40 +0800 Subject: [PATCH] feat: add Docker Compose configuration for PostgreSQL and bot service --- compose.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 compose.yml diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..484654f --- /dev/null +++ b/compose.yml @@ -0,0 +1,30 @@ +services: + postgres: + image: postgres:17 + restart: always + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: 114514 + POSTGRES_DB: postgres + volumes: + - postgres_data:/var/lib/postgresql/data + - ./init.sql:/docker-entrypoint-initdb.d/init.sql + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U postgres" ] + interval: 10s + timeout: 5s + retries: 5 + start_period: 5s + + sbbot: + build: . + restart: always + environment: + TOKEN: ${BOT_TOKEN} + DATABASE_URL: postgresql://postgres:114514@postgres:5432/postgres?sslmode=disable + depends_on: + - postgres + + +volumes: + postgres_data: