first to addDB service

This commit is contained in:
2025-06-15 20:20:54 +01:00
parent 873280d027
commit 9d5fb3f5be
6 changed files with 266 additions and 2 deletions

20
db_service/Dockerfile Normal file
View File

@@ -0,0 +1,20 @@
FROM python:3.11-slim
# Prevent Python from buffering stdout/stderr so logs appear immediately
ENV PYTHONUNBUFFERED=1
# Install system dependencies (none needed for asyncpg on slim)
WORKDIR /app
# Install Python dependencies first to leverage Docker layer caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy service source code only after dependencies
COPY . /app
EXPOSE 8000
# Use Uvicorn as the ASGI server
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]