It works now

This commit is contained in:
Kalzu Rekku
2025-06-11 00:01:10 +03:00
parent 11a565732d
commit 94c988ee7b
9 changed files with 797 additions and 30 deletions

View File

@ -28,15 +28,17 @@ RUN apt-get purge -y build-essential python3-dev && \
# Copy application code
COPY app/ ./app/
# Create directory for RRD data
RUN mkdir -p /app/data
# Create directory for RRD data at /data (will be volume mounted)
RUN mkdir -p /data
# Expose port
EXPOSE 8000
# Create non-root user for security
RUN useradd --create-home --shell /bin/bash appuser && \
chown -R appuser:appuser /app
chown -R appuser:appuser /app && \
chown -R appuser:appuser /data && \
chmod 777 /data
USER appuser
# Health check
@ -44,4 +46,5 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8000/health || exit 1
# Run the application
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]