From ab90ca396382bf7d3b974417fb5d0fc681706214 Mon Sep 17 00:00:00 2001 From: Mario Nachbaur Date: Sat, 18 Jul 2026 10:15:46 +0200 Subject: [PATCH] create Containerfile update example Caddyfile create compose.yaml --- .containerignore | 8 ++++++++ Containerfile | 18 ++++++++++++++++++ compose.yaml | 12 ++++++++++++ etc/Caddyfile | 4 +++- supervisord.conf | 15 +++++++++++++++ 5 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 .containerignore create mode 100644 Containerfile create mode 100644 compose.yaml create mode 100644 supervisord.conf diff --git a/.containerignore b/.containerignore new file mode 100644 index 0000000..530db8a --- /dev/null +++ b/.containerignore @@ -0,0 +1,8 @@ +* +!packages/ +!src/ +!.python-version +!gunicorn.conf.py +!pyproject.toml +!supervisord.conf +!uv.lock diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..614c658 --- /dev/null +++ b/Containerfile @@ -0,0 +1,18 @@ +FROM ghcr.io/astral-sh/uv:debian-slim@sha256:53476714c941e4fe1ec3d7c24c405681752365d882d165a848bc22d84f19106a + +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates supervisor && apt clean + +WORKDIR /app +COPY . . + +ENV UV_NO_DEV=1 +RUN uv sync --locked && uv cache clean + +RUN mkdir -p /data + +ENV FLASK_KEYVAL_DB_URL=/data/keyval.db +ENV FLASK_CONFIG_DB_URL=/data/config.db +ENV PORT=80 +EXPOSE 80 + +CMD [ "supervisord", "-c", "/app/supervisord.conf" ] diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..d460253 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,12 @@ +services: + ligoat: + build: . + image: nauta.one/ligoat + container_name: ligoat + restart: unless-stopped + env_file: + - .env + volumes: + - ./data:/data + ports: + - 8000:80 diff --git a/etc/Caddyfile b/etc/Caddyfile index e2bdebb..8cc1e40 100644 --- a/etc/Caddyfile +++ b/etc/Caddyfile @@ -2,11 +2,13 @@ example.com { handle_path /static/* { # change this to where you have the code root * /var/www/ligoat/src/static - file_sever + file_server } handle { # change this to the port you use reverse_proxy :8080 } + + rewrite /favicon.ico /static/favicon-48.png } diff --git a/supervisord.conf b/supervisord.conf new file mode 100644 index 0000000..f014f03 --- /dev/null +++ b/supervisord.conf @@ -0,0 +1,15 @@ +[supervisord] +nodaemon=true +user=root + +[program:core] +command=uv run -- gunicorn +stdout_logfile=/dev/fd/1 +stdout_logfile_maxbytes=0 +redirect_stderr=true + +[program:ingestor] +command=uv run -- ingestor +stdout_logfile=/dev/fd/1 +stdout_logfile_maxbytes=0 +redirect_stderr=true -- 2.51.2