-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.security-hardening
More file actions
44 lines (34 loc) · 1.13 KB
/
Copy pathDockerfile.security-hardening
File metadata and controls
44 lines (34 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Dockerfile for Security Hardening Service
FROM python:3.14-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
gcc \
g++ \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY sag/ ./sag/
# Create logs directory
RUN mkdir -p /app/logs
# Set environment variables (non-sensitive defaults for development)
# SECURITY: Sensitive values (ENCRYPTION_KEY, SIGNING_KEY) must be provided at runtime
# via Kubernetes secrets, environment variables, or secrets management
ENV PYTHONPATH=/app
ENV DATABASE_URL=sqlite:///security_hardening.db
ENV REDIS_URL=redis://redis:6379/0
ENV DEBUG=true
ENV ENVIRONMENT=development
# Expose port
EXPOSE 8012
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8012/health || exit 1
# Run the application
CMD ["python", "-m", "uvicorn", "sag.services.security_hardening:app", "--host", "0.0.0.0", "--port", "8012"]