deployment improvments

This commit is contained in:
2025-10-16 01:50:43 +02:00
parent f4c5dd483d
commit 62719ef9c3
10 changed files with 192 additions and 38 deletions

8
.dockerignore Normal file
View File

@@ -0,0 +1,8 @@
.git
.gitignore
docker-compose.yml
docker-compose.registry.yml
docker-compose.traefik.yml
id.env
scripts/publish-image.sh
README.md

57
Dockerfile Normal file
View File

@@ -0,0 +1,57 @@
# Use latest official Ubuntu image
FROM ubuntu:latest
# Set timezone
ENV TZ=Europe/Berlin
# Configure timezone data during build
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Avoid interactive prompts during apt install
ARG DEBIAN_FRONTEND=noninteractive
# Install Apache, PHP and required extensions
RUN apt-get update && apt-get install -y \
apache2 \
apache2-utils \
ca-certificates \
php \
libapache2-mod-php \
php-curl \
php-dom \
php-gd \
php-intl \
php-json \
php-mbstring \
php-xml \
php-zip && \
apt-get clean && rm -rf /var/lib/apt/lists/*
# Ensure shared group ownership for collaborative editing
RUN groupadd -g 1111 kirbygroup && usermod -aG kirbygroup www-data
# Provide Apache vhost configuration and entrypoint
COPY default.conf /etc/apache2/sites-available/000-default.conf
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Remove default Apache placeholder page
RUN rm -rf /var/www/html/*
# Copy project into the image
COPY --chown=www-data:kirbygroup . /var/www/html
# Enable required Apache modules
RUN a2enmod headers rewrite
# Ensure collaborative permissions at runtime
RUN chmod -R g+rw /var/www/html && find /var/www/html -type d -exec chmod g+xs {} \;
# Expose web port
EXPOSE 80
# Allow UID remapping before Apache starts
ENTRYPOINT ["/entrypoint.sh"]
# Start Apache in foreground
CMD ["/usr/sbin/apache2ctl", "-DFOREGROUND"]

View File

@@ -1,43 +1,56 @@
<img src="http://getkirby.com/assets/images/github/starterkit.jpg" width="300"> # Lichterei Web Kirby Projekt
**Kirby: the CMS that adapts to any project, loved by developers and editors alike.** Dieses Repository bündelt die Kirby-Installation sowie die Docker-Infrastruktur, damit du das Projekt lokal ausprobieren und im Server-Setup mit Traefik deployen kannst.
The Starterkit is a full-blown Kirby installation with a lot of example content, blueprints, templates and more.
It is ideal for new users to explore many of Kirby's options and get to know the Panel.
You can learn more about Kirby at [getkirby.com](https://getkirby.com). ## Voraussetzungen
- Docker Engine ≥ 20.10 und `docker compose`
- Optional: Composer, falls du Abhängigkeiten aktualisieren möchtest
- Passe vor dem ersten Start den Wert `USERID` in `id.env` an deinen lokalen Benutzer an so vermeidest du Rechteprobleme beim Schreiben ins gemountete Volume.
<img src="http://getkirby.com/assets/images/github/starterkit-screen.png" /> ## Lokale Ausführung
1. `USERID` in `id.env` prüfen/anpassen (`id -u` liefert deinen Wert).
2. Container starten:
```bash
docker compose up --build
```
3. Die Seite ist anschließend unter http://localhost:8080 erreichbar, das Kirby Panel unter http://localhost:8080/panel.
### Try Kirby for free Mit `docker compose down` stoppst du die Umgebung wieder. Inhalte bleiben erhalten, da der Projektordner als Volume eingebunden ist.
You can try Kirby and the Starterkit on your local machine or on a test server as long as you need to make sure it is the right tool for your next project. … and when youre convinced, [buy your license](https://getkirby.com/buy). ## Deployment mit Traefik
1. Domain, Router- und Zertifikatsnamen in `docker-compose.traefik.yml` anpassen.
2. Sicherstellen, dass das externe Netzwerk `proxy` existiert (`docker network create proxy`).
3. Deployment starten:
```bash
docker compose \
-f docker-compose.yml \
-f docker-compose.traefik.yml \
up -d
```
Passe bei Bedarf den Volume-Eintrag in `docker-compose.yml` an (z.B. benanntes Volume oder separater Persistenzpfad).
4. Für den Registry-Workflow steht `scripts/publish-image.sh` bereit. Das Skript baut das Image aus dem aktuellen Stand und pusht es zum konfigurierten Registry-Host.
The Starterkit is a demo of basic Kirby features. It's not recommended to be used "as is" in production. Please, follow our documentation closely for more features and guides on how to build secure, high-quality websites with Kirby. ## Nutzung eines Registry-Images
- Setze vor dem Start die Umgebungsvariable `KIRBY_IMAGE` auf das exakte Image samt Tag oder Digest, z.B.:
```bash
export KIRBY_IMAGE=gitea.mindboost.team/interkollektives/lichterei-web:0.0.1
```
Mit `docker image ls gitea.mindboost.team/interkollektives/lichterei-web` siehst du, welche Tags lokal vorhanden sind. Fehlt der gewünschte Tag, kannst du ihn vergeben: `docker tag <IMAGE_ID> gitea.mindboost.team/...:<tag>`.
- Container aus Registry starten:
```bash
docker compose -f docker-compose.registry.yml up -d
```
`--build` wird hier nicht benötigt, da keine lokale Build-Definition verwendet wird.
- Falls du das Image aktualisierst, entferne das benannte Volume vorher (`docker compose down -v`), damit die neuen Dateien aus dem Image erneut in `/var/www/html` kopiert werden.
- Kombination mit Traefik ist ebenfalls möglich:
```bash
docker compose -f docker-compose.registry.yml -f docker-compose.traefik.yml up -d
```
While Kirby as the CMS software itself requires you to purchase a license, we consider the files primarily connected to this Starterkit (assets, templates, snippets...) free to use under the MIT license. Feel free to start building your own project with them. ## Contribution Guidelines
- Forken oder Branch erstellen, bevor du Änderungen beginnst.
- Lokal mit `docker compose up` arbeiten oder falls du ohne Container entwickeln willst `composer install` ausführen.
- Bitte prüfe, ob deine Änderungen im Frontend sichtbar funktionieren und keine PHP-Fehler im Log landen.
- Pull Request eröffnen und kurz beschreiben, was angepasst wurde und wie getestet wurde.
### Get going Vielen Dank fürs Mitmachen! Bei Fragen melde dich einfach per Issue oder direkt im Team-Chat.
Read our guide on [how to get started with Kirby](https://getkirby.com/docs/guide/quickstart).
You can download the latest version of the Starterkit from https://download.getkirby.com/.
If you are familiar with Git, you can clone Kirby's Starterkit repository from Github.
git clone https://github.com/getkirby/starterkit.git
## What's Kirby?
- **[getkirby.com](https://getkirby.com)** Get to know the CMS.
- **[Try it](https://getkirby.com/try)** Take a test ride with our online demo. Or download one of our kits to get started.
- **[Documentation](https://getkirby.com/docs/guide)** Read the official guide, reference and cookbook recipes.
- **[Issues](https://github.com/getkirby/kirby/issues)** Report bugs and other problems.
- **[Feedback](https://feedback.getkirby.com)** You have an idea for Kirby? Share it.
- **[Forum](https://forum.getkirby.com)** Whenever you get stuck, don't hesitate to reach out for questions and support.
- **[Discord](https://chat.getkirby.com)** Hang out and meet the community.
- **[YouTube](https://youtube.com/kirbyCasts)** - Watch the latest video tutorials visually with Bastian.
- **[Mastodon](https://mastodon.social/@getkirby)** Spread the word.
- **[Bluesky](https://bsky.app/profile/getkirby.com)** Tell a friend.
---
© 2009 Bastian Allgeier
[getkirby.com](https://getkirby.com) · [License agreement](https://getkirby.com/license)

7
default.conf Normal file
View File

@@ -0,0 +1,7 @@
<VirtualHost *:80>
ServerName interkollektives.de
DocumentRoot "/var/www/html"
<Directory "/var/www/html">
AllowOverride All
</Directory>
</VirtualHost>

View File

@@ -0,0 +1,16 @@
services:
kirbycms:
image: ${KIRBY_IMAGE:?Set KIRBY_IMAGE, e.g. gitea.mindboost.team/interkollektives/lichterei-web:0.0.1}
pull_policy: always
container_name: kirbycms
env_file:
- id.env
volumes:
- kirby_data:/var/www/html
ports:
- "8080:80"
restart: unless-stopped
volumes:
kirby_data:
driver: local

View File

@@ -0,0 +1,25 @@
version: "3.8"
services:
kirbycms:
ports: []
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.lichtcms.service=lichtcms"
- "traefik.http.routers.lichtcms.tls.certresolver=http_resolver"
- "traefik.http.routers.lichtcms.tls.domains[0].main=licht.interkollektiv.es"
- "traefik.http.routers.lichtcms.rule=Host(`licht.interkollektiv.es`)"
- "traefik.http.routers.lichtcms.entrypoints=websecure"
- "traefik.http.routers.lichtcms.tls=true"
- "traefik.http.services.lichtcms.loadbalancer.server.port=80"
- "traefik.http.routers.lichtcms-http.rule=Host(`licht.interkollektiv.es`)"
- "traefik.http.routers.lichtcms-http.entrypoints=web"
- "traefik.http.routers.lichtcms-http.middlewares=traefik-https-redirect"
- "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
networks:
- proxy
networks:
proxy:
external: true

16
docker-compose.yml Normal file
View File

@@ -0,0 +1,16 @@
version: "3.8"
services:
kirbycms:
build:
context: .
dockerfile: Dockerfile
image: kirbycms:latest
container_name: kirbycms
env_file:
- id.env
volumes:
- ./:/var/www/html:rw
ports:
- "8080:80"
restart: unless-stopped

10
entrypoint.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
USER_ID="${USERID:-}"
if [[ -n "${USER_ID}" && "${USER_ID}" != "$(id -u www-data)" ]]; then
usermod --uid "${USER_ID}" www-data
fi
exec "$@"

2
id.env Normal file
View File

@@ -0,0 +1,2 @@
# Match the container's www-data user to your local user ID
USERID=1111

View File

@@ -7,10 +7,10 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if PROJECT_ROOT="$(git -C "${SCRIPT_DIR}" rev-parse --show-toplevel 2>/dev/null)"; then if PROJECT_ROOT="$(git -C "${SCRIPT_DIR}" rev-parse --show-toplevel 2>/dev/null)"; then
: :
else else
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)" PROJECT_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
fi fi
DOCKER_CONTEXT="$(cd "${PROJECT_ROOT}/.." && pwd)" DOCKER_CONTEXT="${PROJECT_ROOT}"
DOCKERFILE_PATH="${DOCKER_CONTEXT}/Dockerfile" DOCKERFILE_PATH="${PROJECT_ROOT}/Dockerfile"
REGISTRY_HOST="gitea.mindboost.team" REGISTRY_HOST="gitea.mindboost.team"
IMAGE_NAME="interkollektives/lichterei-web" IMAGE_NAME="interkollektives/lichterei-web"