chore: docker compose update
This commit is contained in:
+32
-11
@@ -1,15 +1,35 @@
|
||||
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.
|
||||
#
|
||||
# - softvowels-db Postgres 16
|
||||
# - softvowels-cms Payload admin + REST/GraphQL API (Node 20)
|
||||
# - softvowels-web nginx serving the static site (Astro build)
|
||||
#
|
||||
# How to access:
|
||||
# 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.
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
services:
|
||||
db:
|
||||
softvowels-db:
|
||||
image: postgres:16-alpine
|
||||
container_name: softvowels-db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: payload
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: softvowels
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
- softvowels-pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U payload -d softvowels"]
|
||||
interval: 10s
|
||||
@@ -18,18 +38,19 @@ services:
|
||||
networks:
|
||||
- nginx_proxy_manager
|
||||
|
||||
cms:
|
||||
softvowels-cms:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./apps/cms/Dockerfile
|
||||
container_name: softvowels-cms
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
db:
|
||||
softvowels-db:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
PORT: 3000
|
||||
DATABASE_URI: postgres://payload:${POSTGRES_PASSWORD}@db:5432/softvowels
|
||||
DATABASE_URI: postgres://payload:${POSTGRES_PASSWORD}@softvowels-db:5432/softvowels
|
||||
PAYLOAD_SECRET: ${PAYLOAD_SECRET}
|
||||
PAYLOAD_PUBLIC_SERVER_URL: https://${CMS_HOSTNAME}
|
||||
SERVER_URL: https://${CMS_HOSTNAME}
|
||||
@@ -37,7 +58,7 @@ services:
|
||||
ASTRO_REVALIDATE_URL: http://host.docker.internal:4321/__revalidate
|
||||
ASTRO_REVALIDATE_TOKEN: ${REVALIDATE_TOKEN}
|
||||
volumes:
|
||||
- cms-uploads:/app/apps/cms/media
|
||||
- softvowels-cms-uploads:/app/apps/cms/media
|
||||
networks:
|
||||
- nginx_proxy_manager
|
||||
|
||||
@@ -46,11 +67,12 @@ services:
|
||||
# ./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.
|
||||
web:
|
||||
softvowels-web:
|
||||
image: nginx:1.27-alpine
|
||||
container_name: softvowels-web
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- cms
|
||||
- softvowels-cms
|
||||
volumes:
|
||||
- ./apps/web/dist:/usr/share/nginx/html:ro
|
||||
- ./apps/web/nginx-default.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
@@ -58,9 +80,8 @@ services:
|
||||
- nginx_proxy_manager
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
cms-uploads:
|
||||
|
||||
softvowels-pgdata:
|
||||
softvowels-cms-uploads:
|
||||
|
||||
networks:
|
||||
nginx_proxy_manager:
|
||||
|
||||
Reference in New Issue
Block a user