initial commit

This commit is contained in:
2025-10-26 23:39:49 -05:00
commit 5fb0909e8d
120 changed files with 11279 additions and 0 deletions

44
Dockerfile Normal file
View File

@@ -0,0 +1,44 @@
# Use official Python Alpine base image
FROM python:3.11-alpine
# Maintainer information
LABEL maintainer="Balotario Licencia A-I"
LABEL description="Interactive web application to study driving license test questions"
LABEL version="1.0.0"
# Set working directory
WORKDIR /app
# Update system packages for security (CVEs)
RUN apk update && apk upgrade --no-cache && \
rm -rf /var/cache/apk/*
# Copy dependency files
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Create non-root user for security
RUN adduser -D -s /bin/sh app && \
chown -R app:app /app
USER app
# Expose port
EXPOSE 5000
# Environment variables
ENV FLASK_APP=app.py
ENV FLASK_ENV=production
ENV PYTHONPATH=/app
# Docker health check command
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:5000/ || exit 1
# Default command
CMD ["python", "run.py"]