-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 951 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (25 loc) · 951 Bytes
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
# Guardian Demo Application Dockerfile
# This creates a minimal, secure container image
FROM python:3.11-slim
# Create non-root user for security
RUN groupadd -r guardian && useradd -r -g guardian guardian
# Set working directory
WORKDIR /app
# Copy application code
COPY app.py .
# Set appropriate permissions
RUN chown -R guardian:guardian /app
# Switch to non-root user
USER guardian
# Expose port
EXPOSE 8080
# Add labels for better container management
LABEL maintainer="Guardians of the Container Galaxy"
LABEL org.opencontainers.image.title="Guardian Demo App"
LABEL org.opencontainers.image.description="Demo application for container security policies"
LABEL org.opencontainers.image.version="1.0.0"
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8080/health')"
# Run the application
CMD ["python", "app.py"]