feat: extract nginx from mp/nginx — initial libreshop/nginx
Some checks failed
Build and publish / build (push) Failing after 19s

Source moved verbatim from mp/nginx/ on 2026-04-29; mp was the first
concrete adapter consuming the libreshop toolkit. Builds and publishes
git.librete.ch/libreshop/nginx on every main / v* push via the standard
.gitea/workflows/build.yml shared across libreshop components.
This commit is contained in:
Michael Czechowski
2026-04-29 17:48:54 +02:00
commit 4501a08675
6 changed files with 134 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
name: Build and publish
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
# Required secrets:
# REGISTRY git.librete.ch
# REGISTRY_USER libretech-bot
# REGISTRY_PASS bot PAT (write:package; bot is in libreshop Owners team)
# Required variable:
# PUBLISH_ENABLED "true" to actually push (off = build-only on PRs)
#
# Image: git.librete.ch/libreshop/nginx
# main pushes → :main + :sha-<short>
# tag pushes → :<tag> + :latest
jobs:
build:
runs-on: ubuntu-latest
container:
image: git.librete.ch/libretech/runner-image:v1
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Login (only when publishing)
if: ${{ vars.PUBLISH_ENABLED == 'true' }}
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASS }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.REGISTRY }}/libreshop/nginx
tags: |
type=ref,event=branch
type=ref,event=tag
type=sha,format=short
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/') }}
- uses: docker/build-push-action@v6
with:
context: .
push: ${{ vars.PUBLISH_ENABLED == 'true' && github.event_name == 'push' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

17
.gitignore vendored Normal file
View File

@@ -0,0 +1,17 @@
logs
cache
# libreshop additions
.env
.env.local
.env.*.local
node_modules/
.nuxt/
.output/
.cache/
.parcel-cache/
dist/
build/
coverage/
logs/
tmp/

8
CHANGELOG.md Normal file
View File

@@ -0,0 +1,8 @@
# Changelog
All notable changes to libreshop/nginx are documented here.
## Unreleased
- Extracted from `mp/nginx/` (2026-04-29). The component history before
the extraction lives in the `muellerprints` repository.

9
Dockerfile Normal file
View File

@@ -0,0 +1,9 @@
# Libre Shop - (Reverse) Proxy
# Version 1.0.0
FROM nginx:1.26.2
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
CMD ["/docker-entrypoint.sh"]

25
README.md Normal file
View File

@@ -0,0 +1,25 @@
# libreshop/nginx
Reverse-proxy template fronting libreshop adapters.
Part of the [libreshop](https://git.librete.ch/libreshop) toolkit. Image
published at `git.librete.ch/libreshop/nginx` on every push to `main`
and on `v*` tags.
## Source
This repo was extracted from `mp/nginx/` on 2026-04-29; mp was the
first concrete adapter consuming the toolkit. mp's `compose.yml` now
pulls `git.librete.ch/libreshop/nginx:<pin>` instead of building locally.
## Build locally
```
docker build -t libreshop/nginx:dev .
```
## Adapter contract
See `docker-entrypoint.sh` and `Dockerfile` for the runtime surface.
Adapters configure the component via env vars and bind-mounted volumes;
do not patch the running container or rely on internal paths.

20
docker-entrypoint.sh Normal file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -e
echo "Generated nginx.conf:"
echo ""
cat /etc/nginx/nginx.conf
mkdir -p /cache/shop
mkdir -p /cache/uploads
mkdir -p /cache/api
echo "Starting nginx"
echo "NGINX_DEBUG=${NGINX_DEBUG}"
# Start Nginx
if [ "$NGINX_DEBUG" = "true" ]; then
sed -i 's/error\.log warn/error.log debug/' /etc/nginx/nginx.conf
exec nginx-debug -g 'daemon off;'
else
exec nginx -g 'daemon off;'
fi