ploughshares/docker/ploughshares/Dockerfile

42 lines
984 B
Docker

FROM python:3.9-bullseye
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
libpq-dev \
gcc \
postgresql-client \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY app.py .
COPY schema.sql .
COPY migrate_approval.py .
COPY templates/ ./templates/
COPY static/ ./static/
# Tests directory is empty or doesn't contain required files
# COPY tests/ ./tests/
# Create uploads directory
RUN mkdir -p uploads
# Set default environment variables for CSP
ENV CSP_JS_HASH="default_js_hash" \
CSP_CSS_HASH="default_css_hash" \
CSP_CUSTOM_CSS_HASH="default_custom_css_hash"
# Set build argument for APP_VERSION
ARG APP_VERSION=unknown
ENV APP_VERSION=$APP_VERSION
# Expose the port the app runs on
EXPOSE 5001
# Command to run the application
CMD ["python", "app.py"]