From 67a25f44c3b23de0dd1fc7964c0193a282a3df10 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 22 Oct 2024 22:13:41 +0100 Subject: [PATCH] Add Dockerfile --- .dockerignore | 1 + Dockerfile | 29 +++++++++++++++++++++++++++++ docker-compose.yml | 5 +++++ 3 files changed, 35 insertions(+) create mode 120000 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 120000 index 0000000..3e4e48b --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +.gitignore \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0ff0097 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +# syntax=docker/dockerfile:1.9 +FROM python:3.13-slim + +WORKDIR /app + +RUN chown www-data /app + +USER www-data + +COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv + +ENV UV_LINK_MODE=copy \ + UV_COMPILE_BYTECODE=1 \ + UV_PYTHON_DOWNLOADS=never \ + UV_PYTHON=python3.13 \ + PYTHONUNBUFFERED=1 \ + PATH=/app/.venv/bin:$PATH + +COPY pyproject.toml uv.lock ./ + +RUN uv sync \ + --locked \ + --no-dev \ + --no-install-project \ + --no-cache + +COPY . /app + +CMD ["granian", "--interface", "asgi", "--host", "0.0.0.0", "main:app"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..7e793ff --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,5 @@ +services: + lwn-feed-proxy: + build: . + ports: + - 8000:8000