Skip to content

Commit 7bdef5b

Browse files
committed
Initial commit
0 parents  commit 7bdef5b

13 files changed

Lines changed: 582 additions & 0 deletions

.github/workflows/docker.yaml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Build Docker image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- "v*.*.*"
9+
10+
pull_request:
11+
branches:
12+
- main
13+
14+
env:
15+
REGISTRY: ghcr.io
16+
IMAGE_NAME: ${{ github.repository }}
17+
18+
# Optional repository variable:
19+
# CADDY_IMAGE=ghcr.io/ludero-git/caddy:2.10.2
20+
#
21+
# Falls back to caddy:latest when the variable is not configured.
22+
CADDY_IMAGE: ${{ vars.CADDY_IMAGE || 'caddy:latest' }}
23+
24+
jobs:
25+
docker:
26+
name: Build Docker image
27+
runs-on: ubuntu-latest
28+
29+
permissions:
30+
contents: read
31+
packages: write
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v7
36+
37+
- name: Set up Docker Buildx
38+
uses: docker/setup-buildx-action@v4
39+
40+
- name: Log in to GHCR
41+
if: github.event_name != 'pull_request'
42+
uses: docker/login-action@v4
43+
with:
44+
registry: ${{ env.REGISTRY }}
45+
username: ${{ github.actor }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
48+
- name: Extract Docker metadata
49+
id: meta
50+
uses: docker/metadata-action@v6
51+
with:
52+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
53+
tags: |
54+
# main branch -> latest
55+
type=raw,value=latest,enable={{is_default_branch}}
56+
57+
# Every build -> sha-a1b2c3d
58+
type=sha,prefix=sha-
59+
60+
# v1.2.3 -> 1.2.3
61+
type=semver,pattern={{version}}
62+
63+
# v1.2.3 -> 1.2
64+
type=semver,pattern={{major}}.{{minor}}
65+
66+
# v1.2.3 -> 1
67+
type=semver,pattern={{major}}
68+
69+
- name: Build and push Docker image
70+
id: build
71+
uses: docker/build-push-action@v7
72+
with:
73+
context: .
74+
file: ./Dockerfile
75+
76+
# PRs are built for validation but are not pushed.
77+
push: ${{ github.event_name != 'pull_request' }}
78+
79+
tags: ${{ steps.meta.outputs.tags }}
80+
labels: ${{ steps.meta.outputs.labels }}
81+
82+
# Pass the configurable Caddy image to Dockerfile.
83+
build-args: |
84+
CADDY_IMAGE=${{ env.CADDY_IMAGE }}
85+
86+
# Make sure e.g. caddy:latest is refreshed.
87+
pull: true
88+
89+
# GitHub Actions BuildKit cache.
90+
cache-from: type=gha
91+
cache-to: type=gha,mode=max

Caddyfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
:{$PORT:3000} {
2+
root * /srv
3+
4+
route {
5+
templates
6+
7+
# Fallback to index.html.
8+
try_files {path} /index.html
9+
10+
# Avoid caching everything.
11+
header {
12+
Cache-Control "no-store, no-cache, must-revalidate"
13+
}
14+
15+
# Only index.html returns 503.
16+
@index path /index.html
17+
file_server @index {
18+
status 503
19+
}
20+
21+
# All other files return their normal status.
22+
file_server
23+
}
24+
}

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ARG CADDY_IMAGE=caddy:latest
2+
3+
FROM ${CADDY_IMAGE}
4+
5+
ENV PORT=3000
6+
ENV ENDTIME=""
7+
8+
COPY Caddyfile /etc/caddy/Caddyfile
9+
COPY site /srv

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Ludero
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Maintenance Page
2+
3+
Maintenance page for Ludero, served using the Caddy web server.
4+
5+
## Local development
6+
7+
### Build
8+
9+
```sh
10+
docker build -t ludero-maintenance:local .
11+
```
12+
13+
Optionally specify the Caddy image:
14+
15+
```sh
16+
docker build \
17+
--build-arg CADDY_IMAGE=caddy:2-alpine \
18+
-t ludero-maintenance:local .
19+
```
20+
21+
### Run
22+
23+
```sh
24+
docker run --rm \
25+
-p 3000:3000 \
26+
-e ENDTIME="2026-08-16T18:00:00+02:00" \
27+
ludero-maintenance:local
28+
```
29+
30+
### Docker Compose
31+
32+
See [docker-compose.yaml](/docker-compose.yaml).
33+
34+
## License
35+
36+
[MIT](/LICENSE)

docker-compose.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
maintenance:
3+
build: .
4+
ports:
5+
- "${PORT:-3000}:${PORT:-3000}"
6+
environment:
7+
PORT: "${PORT:-3000}"
8+
ENDTIME: "${ENDTIME}"

site/apple-touch-icon.png

27.6 KB
Loading

site/favicon-16x16.png

959 Bytes
Loading

site/favicon-32x32.png

2.45 KB
Loading

site/favicon.ico

15 KB
Binary file not shown.

0 commit comments

Comments
 (0)