25 lines
471 B
Docker
25 lines
471 B
Docker
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy requirements first for better caching
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy all application files
|
|
COPY . .
|
|
|
|
# Build assets for production
|
|
RUN python build_assets.py
|
|
|
|
# Set production environment
|
|
ENV FLASK_ENV=production
|
|
ENV FLASK_DEBUG=0
|
|
|
|
# Ensure proper permissions
|
|
RUN chmod +x app.py
|
|
|
|
EXPOSE 5000
|
|
|
|
# Use python module syntax for better reliability
|
|
CMD ["python", "-u", "app.py"] |