Major Refactor: Refactor the codebase to improve readability and maintainability
This commit is contained in:
33
Dockerfile
33
Dockerfile
@@ -1,23 +1,34 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy source code
|
||||
COPY *.py .
|
||||
COPY templates/ ./templates/
|
||||
COPY static/ ./static/
|
||||
#COPY .env .
|
||||
COPY app.py database.py utils.py ./
|
||||
COPY routes/ ./routes/
|
||||
COPY models/ ./models/
|
||||
COPY services/ ./services/
|
||||
COPY templates/ ./templates/
|
||||
COPY static/ ./static/
|
||||
COPY db/ ./db/
|
||||
|
||||
# Create the folder structure for the volume mounts
|
||||
RUN mkdir -p /app/static/cache
|
||||
RUN mkdir -p /app/static/cache /app/db
|
||||
|
||||
RUN useradd --create-home --shell /bin/bash appuser \
|
||||
&& chown -R appuser:appuser /app
|
||||
USER appuser
|
||||
|
||||
EXPOSE 5000
|
||||
|
||||
# Run with unbuffered output so you can actually see the logs in Portainer
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD curl -fsS http://localhost:5000/login >/dev/null || exit 1
|
||||
|
||||
CMD ["python", "app.py"]
|
||||
CMD ["python", "app.py"]
|
||||
|
||||
Reference in New Issue
Block a user