uLinkShortener/Dockerfile
2025-02-21 01:23:57 +01:00

25 lines
484 B
Docker

FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Set environment variables
ENV FLASK_APP=server.py
ENV FLASK_ENV=production
# Expose port
EXPOSE 5000
# Run the application
CMD ["python", "server.py"]