add Docker and CI/CD pipeline with ledo
Some checks failed
Docker - build image / 🏗️ Docker builder (latest from master) 🏗️ (push) Failing after 17s

Configure Next.js static export with nginx serving, Dockerfile
(multi-stage build), docker-compose for prod/dev, Gitea Actions
pipelines for build-on-push and tag-based releases using ledo tool.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 23:49:15 +01:00
parent afb939f629
commit 3438f8d405
11 changed files with 252 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
version: "3.7"
services:
site:
build:
context: ../
target: build
volumes:
- "../:/app"
- "/app/node_modules"
- "/app/.next"
ports:
- "3000:3000"
command: npm run dev
environment:
- NODE_ENV=development
networks:
- network-automancer-dev

11
docker/docker-compose.yml Normal file
View File

@@ -0,0 +1,11 @@
version: "3.7"
services:
site:
image: git.cynarski.pl/automancer/site:latest
ports:
- "8080:8080"
networks:
- network-automancer-dev
networks:
network-automancer-dev: {}

39
docker/docker-entrypoint.sh Executable file
View File

@@ -0,0 +1,39 @@
#!/bin/bash
set -eo pipefail
shopt -s nullglob
#
# H E L P E R F U N C T I O N S
#
##################################
declare -i term_width=80
h1() {
declare border padding text
border='\e[1;34m'"$(printf '=%.0s' $(seq 1 "$term_width"))"'\e[0m'
padding="$(printf ' %.0s' $(seq 1 $(((term_width - $(wc -m <<<"$*")) / 2))))"
text="\\e[1m$*\\e[0m"
echo -e "$border"
echo -e "${padding}${text}${padding}"
echo -e "$border"
}
h2() {
printf '\e[1;33m==>\e[37;1m %s\e[0m\n' "$*"
}
#
# M A I N F U N C T I O N S
#
#################################
h1 "Project init"
###
### Your code here
###
h1 "End of init"
exec "$@"

29
docker/nginx.conf Normal file
View File

@@ -0,0 +1,29 @@
server {
listen 8080;
server_name _;
root /usr/share/nginx/html;
index index.html;
add_header X-Content-Type-Options nosniff always;
add_header X-Frame-Options DENY always;
add_header Referrer-Policy strict-origin-when-cross-origin always;
# Static assets: cache aggressively
location ~* \.(?:css|js|mjs|map|png|jpg|jpeg|gif|svg|ico|webp|woff2|woff|ttf)$ {
expires 30d;
add_header Cache-Control "public, max-age=2592000, immutable";
try_files $uri =404;
}
# HTML: no cache
location ~* \.html$ {
add_header Cache-Control "no-cache";
try_files $uri =404;
}
# Next.js static export: try file, then file.html, then 404
location / {
try_files $uri $uri.html $uri/ /404.html;
}
}

38
docker/test-entrypoint.sh Executable file
View File

@@ -0,0 +1,38 @@
#!/bin/bash
set -eo pipefail
shopt -s nullglob
#
# H E L P E R F U N C T I O N S
#
##################################
declare -i term_width=80
h1() {
declare border padding text
border='\e[1;34m'"$(printf '=%.0s' $(seq 1 "$term_width"))"'\e[0m'
padding="$(printf ' %.0s' $(seq 1 $(((term_width - $(wc -m <<<"$*")) / 2))))"
text="\\e[1m$*\\e[0m"
echo -e "$border"
echo -e "${padding}${text}${padding}"
echo -e "$border"
}
h2() {
printf '\e[1;33m==>\e[37;1m %s\e[0m\n' "$*"
}
#
# M A I N F U N C T I O N S
#
#################################
h1 "Project test init"
###
### Your code here
###
h1 "End of test init"
exec "$@"