Add self-hosted deployment configuration

- Add backend entry point (cmd/server/main.go)
- Add prompt=select_account to Google OAuth flow
- Add combined init.sql for self-hosted PostgreSQL
- Update docker-compose to include backend service with memory limits

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
M1ngdaXie
2026-03-09 01:38:15 +00:00
parent 50822600ad
commit 731bd67334
4 changed files with 567 additions and 2 deletions

View File

@@ -15,6 +15,7 @@ services:
volumes:
- postgres_data:/var/lib/postgresql/data
- ./backend/scripts/init.sql:/docker-entrypoint-initdb.d/init.sql
command: postgres -c shared_buffers=128MB -c max_connections=50
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
@@ -24,7 +25,7 @@ services:
redis:
image: redis:7-alpine
container_name: realtime-collab-redis
command: ["redis-server", "--appendonly", "yes"]
command: ["redis-server", "--appendonly", "yes", "--maxmemory", "64mb", "--maxmemory-policy", "allkeys-lru"]
ports:
- "6379:6379"
volumes:
@@ -35,6 +36,22 @@ services:
timeout: 3s
retries: 5
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: realtime-collab-backend
env_file:
- ./backend/.env
ports:
- "8080:8080"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
volumes:
postgres_data:
redis_data: