CI/CD
This commit is contained in:
+56
-65
@@ -1,62 +1,52 @@
|
||||
# Production: no source mount; image contains code
|
||||
name: ai
|
||||
|
||||
services:
|
||||
db:
|
||||
image: mysql:8.0
|
||||
image: docker.iranserver.com/mysql
|
||||
container_name: ai-db
|
||||
restart: always
|
||||
environment:
|
||||
MYSQL_DATABASE: ${DB_NAME:-ai}
|
||||
MYSQL_USER: ${DB_USER:-ai}
|
||||
MYSQL_DATABASE: ${DB_NAME}
|
||||
MYSQL_USER: ${DB_USER}
|
||||
MYSQL_PASSWORD: ${DB_PASSWORD}
|
||||
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
|
||||
volumes:
|
||||
- ai_mysql_data:/var/lib/mysql
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_ROOT_PASSWORD}"]
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p$${MYSQL_ROOT_PASSWORD}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
phpmyadmin:
|
||||
image: phpmyadmin:latest
|
||||
container_name: ai-phpmyadmin
|
||||
environment:
|
||||
PMA_HOST: db
|
||||
PMA_PORT: 3306
|
||||
UPLOAD_LIMIT: 64M
|
||||
ports:
|
||||
- "8082:80"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- ai-network
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
image: docker.iranserver.com/redis
|
||||
container_name: ai-redis
|
||||
restart: unless-stopped
|
||||
restart: always
|
||||
networks:
|
||||
- ai-network
|
||||
|
||||
qdrant:
|
||||
image: qdrant/qdrant:latest
|
||||
image: docker.iranserver.com/qdrant/qdrant:latest
|
||||
container_name: ai-qdrant
|
||||
ports:
|
||||
- "6333:6333"
|
||||
- "6334:6334"
|
||||
restart: always
|
||||
volumes:
|
||||
- qdrant_data:/qdrant/storage
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- ai-network
|
||||
|
||||
web:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
APT_MIRROR: mirror2.chabokan.net
|
||||
PIP_INDEX_URL: https://package-mirror.liara.ir/repository/pypi/simple
|
||||
PIP_EXTRA_INDEX_URL: https://mirror.cdn.ir/repository/pypi/simple
|
||||
PYTHON_MIRROR: mirror2.chabokan.net
|
||||
dockerfile: Dockerfile
|
||||
container_name: ai-web
|
||||
restart: always
|
||||
command: gunicorn config.wsgi:application --bind 0.0.0.0:8000 --workers 4 --threads 2
|
||||
volumes:
|
||||
- ./logs:/app/logs
|
||||
- ./static:/app/static
|
||||
- ./media:/app/media
|
||||
ports:
|
||||
- "8020:8000"
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
@@ -65,44 +55,45 @@ services:
|
||||
CELERY_RESULT_BACKEND: redis://redis:6379/0
|
||||
QDRANT_HOST: qdrant
|
||||
QDRANT_PORT: 6333
|
||||
DEBUG: "False"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_started
|
||||
qdrant:
|
||||
condition: service_started
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8020:8000"
|
||||
volumes:
|
||||
- ./logs:/app/logs
|
||||
networks:
|
||||
- ai-network
|
||||
|
||||
# celery:
|
||||
# build:
|
||||
# context: .
|
||||
# container_name: ai-celery
|
||||
# restart: always
|
||||
# command: celery -A config worker -l info --concurrency=4
|
||||
# volumes:
|
||||
# - ./logs:/app/logs
|
||||
# - ./media:/app/media
|
||||
# env_file:
|
||||
# - .env
|
||||
# environment:
|
||||
# DB_HOST: db
|
||||
# CELERY_BROKER_URL: redis://redis:6379/0
|
||||
# CELERY_RESULT_BACKEND: redis://redis:6379/0
|
||||
# SKIP_MIGRATE: "1"
|
||||
# DEBUG: "False"
|
||||
# depends_on:
|
||||
# db:
|
||||
# condition: service_healthy
|
||||
# redis:
|
||||
# condition: service_started
|
||||
# networks:
|
||||
# - ai-network
|
||||
|
||||
celery:
|
||||
build:
|
||||
context: .
|
||||
args:
|
||||
APT_MIRROR: mirror2.chabokan.net
|
||||
PIP_INDEX_URL: https://package-mirror.liara.ir/repository/pypi/simple
|
||||
PIP_EXTRA_INDEX_URL: https://mirror.cdn.ir/repository/pypi/simple
|
||||
PYTHON_MIRROR: mirror2.chabokan.net
|
||||
container_name: ai-celery
|
||||
command: celery -A config worker -l info
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
DB_HOST: db
|
||||
CELERY_BROKER_URL: redis://redis:6379/0
|
||||
CELERY_RESULT_BACKEND: redis://redis:6379/0
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_started
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./logs:/app/logs
|
||||
|
||||
volumes:
|
||||
ai_mysql_data:
|
||||
qdrant_data:
|
||||
|
||||
networks:
|
||||
ai-network:
|
||||
driver: bridge
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ services:
|
||||
image: redis:7-alpine
|
||||
container_name: ai-redis
|
||||
ports:
|
||||
- "6380:6379" # host:container — سرویسها داخل شبکه از redis:6379 استفاده میکنند
|
||||
- "6380:6379"
|
||||
|
||||
qdrant:
|
||||
image: qdrant/qdrant:latest
|
||||
|
||||
Reference in New Issue
Block a user