38 lines
823 B
Docker
38 lines
823 B
Docker
FROM python:3.11-slim
|
|
|
|
WORKDIR /app/backend
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
libreoffice \
|
|
poppler-utils \
|
|
libpq-dev \
|
|
gcc \
|
|
python3-dev \
|
|
postgresql-client \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set up virtual environment
|
|
RUN python -m venv /opt/venv
|
|
ENV PATH="/opt/venv/bin:$PATH"
|
|
|
|
# Install Python packages
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir --upgrade pip && \
|
|
pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy the application
|
|
COPY . .
|
|
|
|
# Create necessary directories
|
|
RUN mkdir -p static templates/admin logs
|
|
|
|
# Create entrypoint script
|
|
COPY docker-entrypoint.sh /usr/local/bin/
|
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
|
|
|
EXPOSE ${PORT_BACKEND}
|
|
|
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
|
CMD ["python", "main.py"] |