first to addDB service
This commit is contained in:
20
db_service/Dockerfile
Normal file
20
db_service/Dockerfile
Normal 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"]
|
||||
Reference in New Issue
Block a user