Files
quality_recticel/Dockerfile
2025-10-13 21:18:33 +03:00

42 lines
1001 B
Docker

# Dockerfile for Recticel Quality Application
FROM python:3.10-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
FLASK_APP=run.py \
FLASK_ENV=production
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
default-libmysqlclient-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
# Create app directory
WORKDIR /app
# Copy requirements and install Python dependencies
COPY py_app/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY py_app/ .
# Create necessary directories
RUN mkdir -p /app/instance /srv/quality_recticel/logs
# Create a script to wait for database and initialize
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
# Expose the application port
EXPOSE 8781
# Use the entrypoint script
ENTRYPOINT ["/docker-entrypoint.sh"]
# Run gunicorn
CMD ["gunicorn", "--config", "gunicorn.conf.py", "wsgi:application"]