v2.3
This commit is contained in:
+44
@@ -0,0 +1,44 @@
|
||||
# Dockerfile for Audit Hardening Tool - Web Deployment
|
||||
# Optimized for offline deployment (export/load workflow)
|
||||
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Set environment variables
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
TZ=Asia/Ho_Chi_Minh
|
||||
|
||||
# Install minimal system dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
gcc \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& apt-get clean
|
||||
|
||||
# Copy requirements first for better Docker layer caching
|
||||
COPY requirements.docker.txt ./requirements.txt
|
||||
|
||||
# Install Python dependencies
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Create necessary data directories (mount points)
|
||||
RUN mkdir -p uploads output config keys tools docs
|
||||
|
||||
# Copy entrypoint script
|
||||
COPY docker-entrypoint.sh /usr/local/bin/
|
||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8000
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \
|
||||
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/', timeout=5)" || exit 1
|
||||
|
||||
# Set entrypoint
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
||||
# Run the application with proxy headers support
|
||||
CMD ["uvicorn","web_app_fastapi:app","--host","0.0.0.0","--port","8000","--proxy-headers","--forwarded-allow-ips","*","--root-path","/audit"]
|
||||
Reference in New Issue
Block a user