| |
| FROM python:3.11-slim |
|
|
| |
| WORKDIR /app |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| build-essential \ |
| libpq-dev \ |
| git \ |
| curl \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN git clone https://github.com/JayJay889/CODE-Network.git . && \ |
| git checkout main |
|
|
| |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app |
| USER appuser |
|
|
| |
| ENV FLASK_APP=app.py |
| ENV FLASK_ENV=production |
| ENV PYTHONUNBUFFERED=1 |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ |
| CMD curl -f http://localhost:7860/ || exit 1 |
|
|
| |
| CMD ["python", "app.py"] |