Add local Docker deployment and submodules
- docker-compose.yml: builder, nginx web server and a LaTeX container (profile "latex") for regenerating the SVG drawings - Makefile, scripts/fetch.sh, .env.example - 50ohm, 50ohm-contents-dl and 50ohm-ansible as submodules tracking branch sv Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
# Local deploy of the Swedish 50ohm site.
|
||||
#
|
||||
# make build generate the static site (./50ohm + ./50ohm-contents-dl -> ./site-build)
|
||||
# make up serve it on http://127.0.0.1:8080
|
||||
# make drawings regenerate stale SVG drawings from their .tex sources (profile "latex")
|
||||
#
|
||||
# The repos are bind-mounted, never copied: nothing the containers do ends up in git except
|
||||
# regenerated drawings/*.svg in the content repo (which you do want to commit).
|
||||
# Containers run as your user (HOST_UID/HOST_GID) so no root-owned files appear in the repos.
|
||||
|
||||
x-user: &user "${HOST_UID:-1000}:${HOST_GID:-1000}"
|
||||
|
||||
services:
|
||||
build:
|
||||
build:
|
||||
context: ./docker/builder
|
||||
additional_contexts:
|
||||
src: ./50ohm
|
||||
image: 50ohm-se-builder
|
||||
user: *user
|
||||
volumes:
|
||||
- ./50ohm:/app:ro
|
||||
- ./50ohm-contents-dl:/content:ro
|
||||
- ./site-build:/out
|
||||
profiles: ["build"]
|
||||
|
||||
web:
|
||||
image: nginx:1.27-alpine
|
||||
ports:
|
||||
- "${BIND_ADDR:-127.0.0.1}:${WEB_PORT:-8080}:80"
|
||||
volumes:
|
||||
- ./site-build:/usr/share/nginx/html:ro
|
||||
- ./docker/web/default.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-q", "--spider", "http://127.0.0.1/index.html"]
|
||||
interval: 30s
|
||||
timeout: 3s
|
||||
retries: 3
|
||||
|
||||
latex:
|
||||
build:
|
||||
context: ./docker/latex
|
||||
image: 50ohm-se-latex
|
||||
user: *user
|
||||
working_dir: /content
|
||||
volumes:
|
||||
- ./50ohm-contents-dl:/content
|
||||
- texcache:/cache
|
||||
profiles: ["latex"]
|
||||
|
||||
volumes:
|
||||
texcache:
|
||||
Reference in New Issue
Block a user