first commit
This commit is contained in:
49
docker-compose.yml
Normal file
49
docker-compose.yml
Normal file
@@ -0,0 +1,49 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
environment:
|
||||
POSTGRES_DB: ${POSTGRES_DB:-drivers}
|
||||
POSTGRES_USER: ${POSTGRES_USER:-drivers}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-drivers}
|
||||
ports:
|
||||
- "${POSTGRES_PORT:-5433}:5432"
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-drivers} -d ${POSTGRES_DB:-drivers}"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
|
||||
api:
|
||||
build: .
|
||||
command: sh -c "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000"
|
||||
env_file:
|
||||
- path: .env
|
||||
required: false
|
||||
environment:
|
||||
DATABASE_URL: ${DATABASE_URL:-postgresql+asyncpg://drivers:drivers@db:5432/drivers}
|
||||
BOT_TOKEN: ${BOT_TOKEN:-}
|
||||
API_BASE_URL: ${API_BASE_URL:-http://api:8000}
|
||||
WEBAPP_URL: ${WEBAPP_URL:-http://localhost:8000}
|
||||
ports:
|
||||
- "8000:8000"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
bot:
|
||||
build: .
|
||||
command: python -m bot.main
|
||||
env_file:
|
||||
- path: .env
|
||||
required: false
|
||||
environment:
|
||||
BOT_TOKEN: ${BOT_TOKEN:-}
|
||||
API_BASE_URL: ${API_BASE_URL:-http://api:8000}
|
||||
WEBAPP_URL: ${WEBAPP_URL:-http://localhost:8000}
|
||||
depends_on:
|
||||
- api
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
Reference in New Issue
Block a user