From 262d5fca91bd55af07b5cb58f3f71a0ae05f90ef Mon Sep 17 00:00:00 2001 From: "georg.sinn-schirwitz" Date: Mon, 8 Sep 2025 12:39:46 +0200 Subject: [PATCH] adding Dockerfile and ignores --- .dockerignore | 45 +++++++++++++++++++++++++++++++++++++++++++++ Dockerfile | 22 ++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a41ba9a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,45 @@ +# Git +.git +.gitignore + +# Python +__pycache__ +*.pyc +*.pyo +*.pyd +.Python +env +venv +.venv +pip-log.txt +pip-delete-this-directory.txt + +# Virtual environments +.env +.venv +venv/ +ENV/ + +# IDEs +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# OS +.DS_Store +Thumbs.db + +# Logs +*.log + +# Docker +Dockerfile +.dockerignore + +# Documentation +README.md + +# Service files +*.service diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5a9e1a6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +# Use official Python image +FROM python:3.11-slim + +# Set working directory +WORKDIR /app + +# Install system dependencies if needed (none for this app) +# RUN apt-get update && apt-get install -y gcc && rm -rf /var/lib/apt/lists/* + +# Copy requirements and install Python dependencies +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Copy application code +COPY . . + +# Create a non-root user +RUN useradd --create-home --shell /bin/bash app +USER app + +# Command to run the application +CMD ["python", "main.py"]