27 lines
544 B
Docker
27 lines
544 B
Docker
FROM python:3.11-slim
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy requirements file
|
|
COPY requirements.txt .
|
|
|
|
# Install Python dependencies
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application files
|
|
COPY . .
|
|
|
|
# Generate VAPID keys if .env doesn't exist
|
|
RUN if [ ! -f .env ]; then python generate_vapid_keys.py; fi
|
|
|
|
# Expose the application port
|
|
EXPOSE 8080
|
|
|
|
# Command to run the application
|
|
CMD ["python", "app.py"]
|