Migrate repo from docker to podman
- git mv docker-compose*.yml -> compose*.yml, Dockerfile -> Containerfile (podman-compose picks compose.yml; buildah finds Containerfile first) - compose/compose.dev: x-podman.name_separator_compat (dash container names), explicit app/web healthchecks (OCI export drops image HEALTHCHECK, depends_on service_healthy would hang forever), fixed subnet 10.113.0.0/24 gw 10.113.0.1 for the aardvark-dns resolver - gateway/nginx.conf: resolver + proxy_pass via variables (static proxy_pass resolves once at start; podman-restart.service brings gateway up before app -> dead upstream, 502 until manual restart) - Containerfiles: pin base images to docker.io/library/* (no unqualified-search-registries on hosts), truthful buildah proxy comments - comments/docs: Docker HEALTHCHECK -> container HEALTHCHECK; READMEs, AGENTS.md updated for podman/podman-compose Verified on dev (podman 5.7.0, podman-compose 1.5.0): stack up with dash names, app/web healthy, conversion through gateway returns PDF, gateway survives app container restart without restart (resolver).
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
# Dev-стенд без ключа доступа: WORDPDF_API_KEY не задан → wordpdf.api-key пуст
|
||||
# → ApiKeyFilter прозрачен, springdoc включён. Проект wordpdf-dev — собственные
|
||||
# образы/контейнеры, с прод-запуском (wordpdf-prod, :9010) не конфликтует.
|
||||
# Запуск: podman-compose -f compose.dev.yml up -d --build
|
||||
# Вход: http://<LAN-IP хоста>:9011 (доступен из локальной сети; hostname -I на хосте)
|
||||
name: wordpdf-dev
|
||||
# podman-compose по умолчанию разделяет имя проекта/сервиса/номера подчёркиванием
|
||||
# (wordpdf-dev_app_1). Compat-флаг возвращает docker-style имена (wordpdf-dev-app-1).
|
||||
x-podman:
|
||||
name_separator_compat: true
|
||||
services:
|
||||
app:
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
# Дублирует HEALTHCHECK из Containerfile: podman выгружает образы в OCI,
|
||||
# где поля healthcheck нет — без явного healthcheck depends_on
|
||||
# service_healthy ждал бы healthy вечно. Прокси обнуляем на команде.
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "HTTP_PROXY= http_proxy= HTTPS_PROXY= https_proxy= curl -fsS http://127.0.0.1:8080/actuator/health >/dev/null || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
start_period: 45s
|
||||
retries: 5
|
||||
web:
|
||||
build: ./wordpdf-web
|
||||
restart: unless-stopped
|
||||
# См. комментарий у app: дубль HEALTHCHECK из wordpdf-web/Containerfile
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "http_proxy= https_proxy= wget -qO /dev/null http://127.0.0.1/ || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
start_period: 10s
|
||||
gateway:
|
||||
image: docker.io/library/nginx:alpine
|
||||
volumes:
|
||||
- ./gateway/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
ports: ["9011:80"]
|
||||
depends_on:
|
||||
app:
|
||||
condition: service_healthy
|
||||
web:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
|
||||
networks:
|
||||
# Подсеть зафиксирована намеренно: nginx в gateway/nginx.conf резолвит app/web
|
||||
# через aardvark-dns на шлюзе сети (10.113.0.1), адрес обязан быть
|
||||
# предсказуемым. Оба repo-стенда делят её осознанно: они взаимоисключающие
|
||||
# варианты отладки, одновременно не поднимаются.
|
||||
default:
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 10.113.0.0/24
|
||||
gateway: 10.113.0.1
|
||||
Reference in New Issue
Block a user