deploy: add Dockerfile and docker-compose for production

This commit is contained in:
2026-07-01 13:08:42 +05:30
parent 377ee710a7
commit ad753be7a5
2 changed files with 65 additions and 0 deletions

16
Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM python:3.11-slim
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
RUN mkdir -p /app/logs
CMD ["python", "main.py", "--production"]

49
docker-compose.yml Normal file
View File

@@ -0,0 +1,49 @@
version: "3.9"
networks:
frontend:
external: true
services:
doormile_agents:
build:
context: .
dockerfile: Dockerfile
image: doormile-agents:latest
container_name: doormile_agents
restart: unless-stopped
environment:
# NATS — event bus
- NATS_URL=${NATS_URL}
- NATS_USER=${NATS_USER}
- NATS_PASSWORD=${NATS_PASSWORD}
# Redis — GEO queries, miler presence
- REDIS_HOST=${REDIS_HOST}
- REDIS_PORT=${REDIS_PORT}
- REDIS_PASSWORD=${REDIS_PASSWORD}
# Postgres — booking history, outcome tracking
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
# Go backend — internal API calls
- GO_API_BASE_URL=${GO_API_BASE_URL}
- INTERNAL_API_KEY=${INTERNAL_API_KEY}
# AI layer — decision engine
- AI_LAYER_BASE_URL=${AI_LAYER_BASE_URL}
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
# Logging
- LOG_LEVEL=${LOG_LEVEL:-INFO}
volumes:
- ./logs:/app/logs
networks:
- frontend
deploy:
resources:
limits:
cpus: "1.0"
memory: 512M
reservations:
cpus: "0.25"
memory: 128M