29 lines
658 B
Docker
29 lines
658 B
Docker
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies if any are needed (none for pure python/FastAPI)
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy requirements and install dependencies
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application files
|
|
COPY . .
|
|
|
|
# Expose port 8000
|
|
EXPOSE 8000
|
|
|
|
# Set environment variables
|
|
ENV HOST=0.0.0.0
|
|
ENV PORT=8000
|
|
ENV CONFIG_PATH=/config/config.json
|
|
|
|
# Create configuration directory
|
|
RUN mkdir -p /config
|
|
|
|
# Run the application
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|