From 2fb086b1a1c8f34f8a3e02ff14760076074da7c9 Mon Sep 17 00:00:00 2001 From: Pino Date: Thu, 11 Jun 2026 00:13:21 +0200 Subject: [PATCH] =?UTF-8?q?INFRA-001:=20Docker-Compose-Basis=20f=C3=BCr=20?= =?UTF-8?q?SillyHome=20Next=20anlegen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 17 +++++++++++++++++ .env.example | 2 +- Dockerfile | 15 +++++++++++++++ docker-compose.yml | 8 ++++++++ 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..12a23fc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,17 @@ +.env +.env.* +!.env.example +.venv +.venv/* +__pycache__ +.mypy_cache +.pytest_cache +.ruff_cache +node_modules +.idea +.vscode +.git +.gitignore +README.md +.dockerignore +docker-compose*.yml \ No newline at end of file diff --git a/.env.example b/.env.example index f6be041..8969042 100644 --- a/.env.example +++ b/.env.example @@ -1,2 +1,2 @@ SILLYHOME_HA_URL=http://homeassistant.local:8123 -SILLYHOME_HA_TOKEN=REPLACE_ME_WITH_LONG_LIVED_TOKEN +SILLYHOME_HA_TOKEN=REPLACE_ME_WITH_LONG_LIVED_TOKEN \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fc7cc17 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM python:3.13-slim + +ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 + +WORKDIR /app + +COPY pyproject.toml ./ +RUN python -m pip install --upgrade pip && \ + pip install --no-cache-dir -e ".[dev]" + +COPY . . + +EXPOSE 8000 + +CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9c0385a --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +services: + api: + build: . + ports: + - "8000:8000" + env_file: + - .env + restart: unless-stopped \ No newline at end of file