60 lines
1.2 KiB
YAML
60 lines
1.2 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16
|
|
container_name: crosspost_db
|
|
restart: unless-stopped
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- ${POSTGRES_DIR}:/var/lib/postgresql/data
|
|
- ./server/db/schema.sql:/docker-entrypoint-initdb.d/schema.sql
|
|
|
|
redis:
|
|
image: redis:7
|
|
container_name: crosspost_redis
|
|
restart: unless-stopped
|
|
ports:
|
|
- "6379:6379"
|
|
|
|
backend:
|
|
build: .
|
|
container_name: crosspost_flask
|
|
volumes:
|
|
- .:/app
|
|
- model_cache:/models
|
|
env_file:
|
|
- .env
|
|
ports:
|
|
- "5000:5000"
|
|
command: flask --app server.app run --host=0.0.0.0 --debug
|
|
depends_on:
|
|
- postgres
|
|
- redis
|
|
|
|
worker:
|
|
build: .
|
|
volumes:
|
|
- .:/app
|
|
- model_cache:/models
|
|
container_name: crosspost_worker
|
|
env_file:
|
|
- .env
|
|
command: >
|
|
celery -A server.queue.celery_app.celery worker
|
|
--loglevel=info
|
|
--pool=solo
|
|
depends_on:
|
|
- postgres
|
|
- redis
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
|
|
volumes:
|
|
model_cache: |