It works now
This commit is contained in:
11
Dockerfile
11
Dockerfile
@ -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"]
|
||||
|
||||
|
Reference in New Issue
Block a user