test_api/docker-compose.yml

63 lines
1.2 KiB
YAML
Raw Permalink Normal View History

2024-03-14 22:27:37 +03:00
version: "3.8"
services:
2024-03-14 23:01:58 +03:00
redis:
container_name: redisdb
image: redis:7.2.4-alpine3.19
ports:
- '7379:6379'
healthcheck:
test: [ "CMD", "redis-cli","ping" ]
interval: 10s
timeout: 5s
retries: 5
2024-03-14 22:27:37 +03:00
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: .
ports:
- 8000:8000
depends_on:
db:
condition: service_healthy
2024-03-14 23:01:58 +03:00
redis:
condition: service_healthy
2024-03-14 22:27:37 +03:00
restart: always
volumes:
2024-03-14 23:01:58 +03:00
- ./config/api_config.yml:/usr/src/test_api/config/api_config.yml
- ./test_api:/usr/src/test_api/test_api
- ./alembic.ini:/usr/src/test_api/alembic.ini
2024-03-14 22:27:37 +03:00
2024-03-15 01:49:04 +03:00
command: /bin/bash -c 'cd /usr/src/test_api && alembic upgrade head && poetry run uvicorn test_api.app:create_app --host 0.0.0.0 --reload --factory'