From 6491d9356a547280c12660e6899e64d79c81fe6e Mon Sep 17 00:00:00 2001 From: pacnpal <183241239+pacnpal@users.noreply.github.com> Date: Tue, 28 Jan 2025 13:38:21 -0500 Subject: [PATCH] feat(docker): add Dockerfile and .dockerignore for containerized environment setup --- .dockerignore | 47 +++++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..661c8a1 --- /dev/null +++ b/.dockerignore @@ -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 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..171aa97 --- /dev/null +++ b/Dockerfile @@ -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"] \ No newline at end of file