Added watchdog for celery in dev mode to apply changes Fix Overwritten of worker settings. Priority keys over .env overwrites Chore: Script fixes of master,worker
185 lines
3.9 KiB
YAML
185 lines
3.9 KiB
YAML
services:
|
|
|
|
mariadb:
|
|
image: mariadb:10.11
|
|
container_name: mariadb
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: password
|
|
MYSQL_DATABASE: theapi
|
|
MYSQL_USER: theapi_user
|
|
MYSQL_PASSWORD: theapi_password
|
|
ports:
|
|
- "3306:3306"
|
|
volumes:
|
|
- mariadb_data:/var/lib/mysql
|
|
- ./initdb:/docker-entrypoint-initdb.d
|
|
healthcheck:
|
|
test: ["CMD", "mysqladmin", "ping", "-ppassword"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
|
|
redis-server:
|
|
image: redis
|
|
container_name: redis-server
|
|
ports:
|
|
- "6379:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
|
|
novnc:
|
|
image: theasp/novnc
|
|
container_name: novnc
|
|
ports:
|
|
- "6081:6080"
|
|
- "8085:8080"
|
|
|
|
|
|
db-migrate:
|
|
build:
|
|
context: ./app
|
|
image: xcloudify-flask-base
|
|
container_name: db-migrate
|
|
env_file: .env
|
|
volumes:
|
|
- .:/app
|
|
working_dir: /app
|
|
command: python manage.py migrations:apply
|
|
depends_on:
|
|
mariadb:
|
|
condition: service_healthy
|
|
restart: "no"
|
|
|
|
api-server:
|
|
build:
|
|
context: ./app
|
|
image: xcloudify-flask-base
|
|
container_name: api-server
|
|
env_file: .env
|
|
environment:
|
|
FLASK_APP: api_server.py
|
|
FLASK_ENV: ${FLASK_ENV:-development}
|
|
volumes:
|
|
- .:/app
|
|
working_dir: /app
|
|
command: >
|
|
sh -c "flask run --host=0.0.0.0 --port=5000 --debug"
|
|
ports:
|
|
- "5000:5000"
|
|
depends_on:
|
|
mariadb:
|
|
condition: service_healthy
|
|
redis-server:
|
|
condition: service_healthy
|
|
db-migrate:
|
|
condition: service_completed_successfully
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:5000/api/healthz"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
|
|
websocket-server:
|
|
build:
|
|
context: .
|
|
container_name: websocket-server
|
|
entrypoint: ["/app/app/entrypoint.sh"]
|
|
command: ["python3", "-m", "websocket_server.main"]
|
|
ports:
|
|
- "6001:6001"
|
|
env_file: .env
|
|
volumes:
|
|
- .:/app
|
|
working_dir: /app
|
|
depends_on:
|
|
mariadb:
|
|
condition: service_healthy
|
|
redis-server:
|
|
condition: service_healthy
|
|
|
|
|
|
vnc-proxy:
|
|
build:
|
|
context: .
|
|
container_name: vnc-proxy
|
|
entrypoint: ["/app/app/entrypoint.sh"]
|
|
command: ["python3", "vnc_proxy.py"]
|
|
ports:
|
|
- "6002:6002"
|
|
env_file: .env
|
|
volumes:
|
|
- .:/app
|
|
working_dir: /app
|
|
depends_on:
|
|
- websocket-server
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:6002/healthz"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
|
|
|
|
# streamlit-server:
|
|
# build:
|
|
# context: .
|
|
# container_name: streamlit-server
|
|
# command: streamlit run streamlit_server.py --server.port=8501 --server.address=0.0.0.0
|
|
# ports:
|
|
# - "8501:8501"
|
|
# volumes:
|
|
# - .:/app
|
|
# working_dir: /app
|
|
# environment:
|
|
# SOCKET_SERVER_URL: http://172.17.0.1:6001
|
|
|
|
celery-worker:
|
|
build:
|
|
context: app/
|
|
container_name: celery-worker
|
|
entrypoint: ["/app/app/entrypoint.sh"]
|
|
command: ["celery", "-A", "app.celery_app.celery", "worker", "--loglevel=info"]
|
|
env_file: .env
|
|
volumes:
|
|
- .:/app
|
|
working_dir: /app
|
|
depends_on:
|
|
mariadb:
|
|
condition: service_healthy
|
|
redis-server:
|
|
condition: service_healthy
|
|
|
|
celery-beat:
|
|
build:
|
|
context: app/
|
|
container_name: celery-beat
|
|
entrypoint: ["/app/app/entrypoint.sh"]
|
|
command: ["celery", "-A", "app.celery_app.celery", "beat", "--loglevel=info"]
|
|
env_file: .env
|
|
volumes:
|
|
- .:/app
|
|
working_dir: /app
|
|
depends_on:
|
|
mariadb:
|
|
condition: service_healthy
|
|
redis-server:
|
|
condition: service_healthy
|
|
|
|
|
|
# php-my-admin:
|
|
# container_name: pma
|
|
# image: phpmyadmin/phpmyadmin
|
|
# ports:
|
|
# - "6789:80"
|
|
# environment:
|
|
# PMA_HOST: mariadb
|
|
|
|
volumes:
|
|
mariadb_data:
|