35 lines
806 B
Docker
35 lines
806 B
Docker
# Example Dockerfile showing how to use the new startup system
|
|
# This is a reference - not meant to replace your existing Dockerfile
|
|
|
|
FROM python:3.11-slim
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy requirements and install dependencies
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application code
|
|
COPY . .
|
|
|
|
# Make startup script executable
|
|
RUN chmod +x start.sh
|
|
|
|
# Set environment variables
|
|
ENV PYTHONPATH=/app
|
|
ENV UVICORN_PORT=8000
|
|
ENV UVICORN_WORKERS=4
|
|
|
|
# Expose port
|
|
EXPOSE 8000
|
|
|
|
# Use the new startup script in production mode
|
|
CMD ["./start.sh", "prod"]
|
|
|
|
# Alternative: Run initialization first, then production server
|
|
# CMD ["sh", "-c", "./start.sh init && ./start.sh prod"]
|
|
|
|
# Alternative: Use Python directly
|
|
# CMD ["python3", "main.py", "--mode", "prod"]
|