164 lines
5.4 KiB
YAML
164 lines
5.4 KiB
YAML
|
|
services:
|
||
|
|
db:
|
||
|
|
image: mirror-docker.runflare.com/library/mysql:8
|
||
|
|
container_name: croplogic-db
|
||
|
|
environment:
|
||
|
|
MYSQL_DATABASE: ${DB_NAME}
|
||
|
|
MYSQL_USER: ${DB_USER}
|
||
|
|
MYSQL_PASSWORD: ${DB_PASSWORD}
|
||
|
|
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
|
||
|
|
volumes:
|
||
|
|
- backend_mysql_data:/var/lib/mysql
|
||
|
|
ports:
|
||
|
|
- "3306:3306"
|
||
|
|
restart: unless-stopped
|
||
|
|
healthcheck:
|
||
|
|
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_ROOT_PASSWORD}"]
|
||
|
|
interval: 10s
|
||
|
|
timeout: 5s
|
||
|
|
retries: 5
|
||
|
|
networks:
|
||
|
|
- crop_network
|
||
|
|
|
||
|
|
redis:
|
||
|
|
image: mirror-docker.runflare.com/library/redis:7-alpine
|
||
|
|
container_name: backend-redis
|
||
|
|
command: ["redis-server", "--appendonly", "yes", "--save", "60", "1"]
|
||
|
|
restart: unless-stopped
|
||
|
|
healthcheck:
|
||
|
|
test: ["CMD", "redis-cli", "ping"]
|
||
|
|
interval: 5s
|
||
|
|
timeout: 3s
|
||
|
|
retries: 10
|
||
|
|
volumes:
|
||
|
|
- backend_redis_data:/data
|
||
|
|
networks:
|
||
|
|
- crop_network
|
||
|
|
|
||
|
|
accsess:
|
||
|
|
image: mirror-docker.runflare.com/openpolicyagent/opa:0.67.1-static
|
||
|
|
container_name: backend-accsess
|
||
|
|
command: ["run", "--server", "--addr=0.0.0.0:8181", "/policies/authz.rego"]
|
||
|
|
volumes:
|
||
|
|
- ../accsess/policies:/policies:ro
|
||
|
|
restart: unless-stopped
|
||
|
|
networks:
|
||
|
|
- crop_network
|
||
|
|
|
||
|
|
|
||
|
|
web:
|
||
|
|
container_name: backend-web
|
||
|
|
build:
|
||
|
|
context: .
|
||
|
|
dockerfile: Dockerfile.Dev
|
||
|
|
args:
|
||
|
|
BASE_IMAGE: mirror-docker.runflare.com/library/python:3.10-slim-bookworm
|
||
|
|
APT_MIRROR: mirror-linux.runflare.com/debian
|
||
|
|
APT_SECURITY_MIRROR: mirror-linux.runflare.com/debian-security
|
||
|
|
PIP_INDEX_URL: https://mirror-pypi.runflare.com/simple
|
||
|
|
PIP_TRUSTED_HOST: mirror-pypi.runflare.com
|
||
|
|
env_file:
|
||
|
|
- .env
|
||
|
|
environment:
|
||
|
|
DOCKER_VERSION: ${DOCKER_VERSION:-production}
|
||
|
|
ALLOWED_HOSTS: ${ALLOWED_HOSTS:-localhost,127.0.0.1,0.0.0.0,web,backend-web}
|
||
|
|
AI_SERVICE_BASE_URL: ${AI_SERVICE_BASE_URL:-http://ai-web:8000}
|
||
|
|
AI_SERVICE_HOST_HEADER: ${AI_SERVICE_HOST_HEADER:-localhost}
|
||
|
|
DB_HOST: croplogic-db
|
||
|
|
CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://backend-redis:6379/0}
|
||
|
|
CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND:-redis://backend-redis:6379/0}
|
||
|
|
QDRANT_HOST: ${QDRANT_HOST:-qdrant}
|
||
|
|
QDRANT_PORT: ${QDRANT_PORT:-6333}
|
||
|
|
SKIP_MIGRATE: "0"
|
||
|
|
ACCESS_CONTROL_AUTHZ_BASE_URL: http://croplogic-accsess-opa:8181
|
||
|
|
depends_on:
|
||
|
|
db:
|
||
|
|
condition: service_healthy
|
||
|
|
redis:
|
||
|
|
condition: service_healthy
|
||
|
|
accsess:
|
||
|
|
condition: service_started
|
||
|
|
restart: unless-stopped
|
||
|
|
networks:
|
||
|
|
- crop_network
|
||
|
|
|
||
|
|
celery:
|
||
|
|
container_name: backend-celery
|
||
|
|
build:
|
||
|
|
context: .
|
||
|
|
dockerfile: Dockerfile.Dev
|
||
|
|
args:
|
||
|
|
BASE_IMAGE: mirror-docker.runflare.com/library/python:3.10-slim-bookworm
|
||
|
|
APT_MIRROR: mirror-linux.runflare.com/debian
|
||
|
|
APT_SECURITY_MIRROR: mirror-linux.runflare.com/debian-security
|
||
|
|
PIP_INDEX_URL: https://mirror-pypi.runflare.com/simple
|
||
|
|
PIP_TRUSTED_HOST: mirror-pypi.runflare.com
|
||
|
|
command: ["celery", "-A", "config", "worker", "-l", "info"]
|
||
|
|
env_file:
|
||
|
|
- .env
|
||
|
|
environment:
|
||
|
|
DOCKER_VERSION: ${DOCKER_VERSION:-production}
|
||
|
|
ALLOWED_HOSTS: ${ALLOWED_HOSTS:-localhost,127.0.0.1,0.0.0.0,web,backend-web}
|
||
|
|
AI_SERVICE_BASE_URL: ${AI_SERVICE_BASE_URL:-http://ai-web:8000}
|
||
|
|
AI_SERVICE_HOST_HEADER: ${AI_SERVICE_HOST_HEADER:-localhost}
|
||
|
|
DB_HOST: croplogic-db
|
||
|
|
CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://backend-redis:6379/0}
|
||
|
|
CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND:-redis://backend-redis:6379/0}
|
||
|
|
CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP: "true"
|
||
|
|
SKIP_MIGRATE: "1"
|
||
|
|
ACCESS_CONTROL_AUTHZ_BASE_URL: http://croplogic-accsess-opa:8181
|
||
|
|
depends_on:
|
||
|
|
db:
|
||
|
|
condition: service_healthy
|
||
|
|
redis:
|
||
|
|
condition: service_healthy
|
||
|
|
accsess:
|
||
|
|
condition: service_started
|
||
|
|
restart: unless-stopped
|
||
|
|
networks:
|
||
|
|
- crop_network
|
||
|
|
|
||
|
|
celery-beat:
|
||
|
|
container_name: backend-celery-beat
|
||
|
|
build:
|
||
|
|
context: .
|
||
|
|
dockerfile: Dockerfile.Dev
|
||
|
|
args:
|
||
|
|
BASE_IMAGE: mirror-docker.runflare.com/library/python:3.10-slim-bookworm
|
||
|
|
APT_MIRROR: mirror-linux.runflare.com/debian
|
||
|
|
APT_SECURITY_MIRROR: mirror-linux.runflare.com/debian-security
|
||
|
|
PIP_INDEX_URL: https://mirror-pypi.runflare.com/simple
|
||
|
|
PIP_TRUSTED_HOST: mirror-pypi.runflare.com
|
||
|
|
command: ["celery", "-A", "config", "beat", "-l", "info"]
|
||
|
|
env_file:
|
||
|
|
- .env
|
||
|
|
environment:
|
||
|
|
DOCKER_VERSION: ${DOCKER_VERSION:-production}
|
||
|
|
ALLOWED_HOSTS: ${ALLOWED_HOSTS:-localhost,127.0.0.1,0.0.0.0,web,backend-web}
|
||
|
|
AI_SERVICE_BASE_URL: ${AI_SERVICE_BASE_URL:-http://ai-web:8000}
|
||
|
|
AI_SERVICE_HOST_HEADER: ${AI_SERVICE_HOST_HEADER:-localhost}
|
||
|
|
DB_HOST: croplogic-db
|
||
|
|
CELERY_BROKER_URL: ${CELERY_BROKER_URL:-redis://backend-redis:6379/0}
|
||
|
|
CELERY_RESULT_BACKEND: ${CELERY_RESULT_BACKEND:-redis://backend-redis:6379/0}
|
||
|
|
CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP: "true"
|
||
|
|
SKIP_MIGRATE: "1"
|
||
|
|
ACCESS_CONTROL_AUTHZ_BASE_URL: http://croplogic-accsess-opa:8181
|
||
|
|
depends_on:
|
||
|
|
db:
|
||
|
|
condition: service_healthy
|
||
|
|
redis:
|
||
|
|
condition: service_healthy
|
||
|
|
accsess:
|
||
|
|
condition: service_started
|
||
|
|
restart: unless-stopped
|
||
|
|
networks:
|
||
|
|
- crop_network
|
||
|
|
|
||
|
|
networks:
|
||
|
|
crop_network:
|
||
|
|
external: true
|
||
|
|
|
||
|
|
volumes:
|
||
|
|
backend_mysql_data:
|
||
|
|
backend_redis_data:
|