update docker-compose.yml for build

This commit is contained in:
2026-04-06 18:59:01 +08:00
parent f754f6a275
commit 4206c57478

View File

@@ -1,30 +1,50 @@
services:
db:
image: timescale/timescaledb:latest-pg17
container_name: agentbase-db
environment:
POSTGRES_DB: openclaw_archive
POSTGRES_USER: openclaw
POSTGRES_PASSWORD: openclaw_archive_pass
volumes:
- ./db_data:/var/lib/postgresql/data
- ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql:ro
ports:
- "5432:5432"
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U openclaw"]
interval: 10s
timeout: 5s
retries: 5
web:
build:
context: .
dockerfile: Dockerfile
container_name: openclaw-archive
container_name: agentbase-web
env_file:
- .env
environment:
DB_HOST: db
DB_PORT: 5432
DB_NAME: openclaw_archive
DB_USER: openclaw
DB_PASSWORD: openclaw_archive_pass
ports:
- "${DJANGO_PORT:-6789}:${DJANGO_PORT:-8000}"
- "8000:8000"
volumes:
- static_volume:/app/staticfiles
- jsonl_archive:/app/archive
- ./static_volume:/app/staticfiles
depends_on:
db:
condition: service_healthy
restart: unless-stopped
# nginx placeholder (uncomment for production)
# nginx:
# image: nginx:alpine
# container_name: openclaw-nginx
# ports:
# - "80:80"
# volumes:
# - ./nginx/nginx.conf:/etc/nginx/nginx.conf
# - static_volume:/app/staticfiles:ro
# depends_on:
# - web
command: >
sh -c "python manage.py migrate &&
python manage.py createsuperuser --noinput ||
true &&
gunicorn --bind 0.0.0.0:8000 --workers 2 --timeout 120 config.wsgi:application"
volumes:
db_data:
static_volume:
jsonl_archive: