This commit is contained in:
Timothy Rogers 2024-11-10 16:01:57 -05:00
parent f1da01193b
commit b0a4567169
20 changed files with 1734 additions and 0 deletions

40
Dockerfile Normal file
View file

@ -0,0 +1,40 @@
# Use Python 3.9 slim image
FROM python:3.9-slim
# Set working directory
WORKDIR /app
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV FLASK_APP=app.py
ENV FLASK_ENV=production
# Install system dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy project
COPY . .
# Create uploads directory
RUN mkdir -p static/uploads
# Make entrypoint script executable
RUN chmod +x entrypoint.sh
# Create volume for uploads
VOLUME /app/static/uploads
# Expose port
EXPOSE 5000
# Use the entrypoint script
ENTRYPOINT ["./entrypoint.sh"]