fix: payload building issues

This commit is contained in:
2026-06-17 23:58:51 +05:30
parent d3ab5028af
commit e974313f6d
15 changed files with 264 additions and 271 deletions
+19 -20
View File
@@ -4,19 +4,23 @@ name: softvowels
# SoftVowels — production docker-compose
#
# This stack publishes a static site (Astro) and a PayloadCMS
# admin panel. Both attach to the homeserver's existing
# `nginx_proxy_manager` network so Nginx Proxy Manager can
# reverse-proxy them with TLS.
# admin panel. All three containers attach to the homeserver's
# existing `nginx_proxy_manager` network so Nginx Proxy Manager
# can reverse-proxy them with TLS.
#
# - softvowels-db Postgres 16
# - softvowels-cms Payload admin + REST/GraphQL API (Node 20)
# - softvowels-web nginx serving the static site (Astro build)
# - softvowels-cms Payload admin + REST/GraphQL API (Node 20,
# Next.js standalone output)
# - softvowels-web nginx serving the static site (Astro build,
# dist baked into the image)
#
# How to access:
# How to access (after `docker compose up -d --build`):
# 1. https://softvowels.example -> softvowels-web:80
# 2. https://cms.softvowels.example -> softvowels-cms:3000/admin
# Add both as "Proxy Hosts" in Nginx Proxy Manager, pointing
# to the matching container name + port. See README.
# Add both as "Proxy Hosts" in Nginx Proxy Manager, pointing to
# the matching container name + port. See README.
#
# Host requirements: Docker only. No Node, no pnpm, no git needed.
# ----------------------------------------------------------------
services:
@@ -55,27 +59,22 @@ services:
PAYLOAD_PUBLIC_SERVER_URL: https://${CMS_HOSTNAME}
SERVER_URL: https://${CMS_HOSTNAME}
CORS_ORIGINS: https://${WEB_HOSTNAME},http://localhost:4321
ASTRO_REVALIDATE_URL: http://host.docker.internal:4321/__revalidate
ASTRO_REVALIDATE_TOKEN: ${REVALIDATE_TOKEN}
# media uploads persist in a named volume mounted at the same
# path Next standalone's CWD expects. Payload's Media collection
# uses `staticDir: 'media'` relative to apps/cms.
volumes:
- softvowels-cms-uploads:/app/apps/cms/media
- softvowels-cms-uploads:/repo/apps/cms/media
networks:
- nginx_proxy_manager
# The public site. We deliberately do NOT bake dist/ into the image:
# scripts/rebuild.sh (run by the host-side webhook) writes fresh HTML to
# ./apps/web/dist on the host, and we mount that path into nginx. That way
# publishing in /admin → new content is live within ~30-60s without any
# docker build / image push step.
softvowels-web:
image: nginx:1.27-alpine
build:
context: .
dockerfile: ./apps/web/Dockerfile
container_name: softvowels-web
restart: unless-stopped
depends_on:
- softvowels-cms
volumes:
- ./apps/web/dist:/usr/share/nginx/html:ro
- ./apps/web/nginx-default.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- nginx_proxy_manager