feat(docker): add Dockerfile and .dockerignore for containerized environment setup

This commit is contained in:
pacnpal
2025-01-28 13:38:21 -05:00
parent 31058ed494
commit 6491d9356a
2 changed files with 80 additions and 0 deletions

47
.dockerignore Normal file
View File

@@ -0,0 +1,47 @@
# Version control
.git
.gitignore
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# Virtual environments
venv/
ENV/
.env
# IDE
.idea/
.vscode/
*.swp
*.swo
# Test
.pytest_cache/
.coverage
htmlcov/
# Project specific
rules_backup/
# Documentation
*.md

33
Dockerfile Normal file
View File

@@ -0,0 +1,33 @@
# Use official Python base image
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the source code
COPY . .
# Install the package in editable mode
RUN pip install -e .
# Default environment variables
ENV ADGUARD_HOST="http://localhost" \
ADGUARD_PORT=3000
# Expose the application port
EXPOSE 8000
# Command to run the application
CMD ["python", "-m", "simpleguardhome.main"]