service_man/docker-compose.yml

122 lines
2.3 KiB
YAML

version: "3.8"
services:
db:
container_name: pgdb
image: postgres:15.1-alpine
env_file:
- .env
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- 6432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
api:
container_name: api
build:
context: .
dockerfile: ./docker/api/Dockerfile
ports:
- 8000:8000
depends_on:
db:
condition: service_healthy
restart: always
volumes:
- ./config/api_config.yml:/usr/src/service_man/config/api_config.yml
- ./api:/usr/src/service_man/api
# - ./alembic.ini:/usr/src/service_man/alembic.ini
command: /bin/bash -c 'cd /usr/src/service_man && poetry run uvicorn api.app_builder.main:app_factory --host 0.0.0.0 --reload --factory'
# bot:
# container_name: bot
#
# build:
# context: .
# dockerfile: ./docker/bot/Dockerfile
#
# env_file:
# - .env
#
# ports:
# - 8001:8000
#
# depends_on:
# db:
# condition: service_healthy
#
# restart: always
#
# volumes:
# - ./tg_bot:/usr/src/service_man/tg_bot
#
# command: /bin/bash -c 'cd /usr/src/service_man/tg_bot && poetry run uvicorn app:create_app --host 0.0.0.0 --reload --factory'
#
# celery_worker:
# container_name: celeryworker
#
# build:
# context: .
#
# env_file:
# - .env
#
# depends_on:
# - rabbitmq
# - db
# - app
# - redis
#
# volumes:
# - .:/usr/src/fastfood
#
# command: ["celery", "-A", "bg_tasks.bg_task:celery_app", "worker", "--loglevel=info", "--concurrency", "1", "-P", "solo"]
#
# celery_beat:
# container_name: celerybeat
#
# build:
# context: .
#
# env_file:
# - .env
#
# depends_on:
# - rabbitmq
# - db
# - app
# - redis
#
# volumes:
# - .:/usr/src/fastfood
#
# command: ["celery", "-A", "bg_tasks.bg_task:celery_app", "beat", "--loglevel=info"]
#
#
# rabbitmq:
# container_name: rabbit
#
# image: "rabbitmq:management"
#
# ports:
# - 5672:5672