chore: docker compose update
This commit is contained in:
+32
-11
@@ -1,15 +1,35 @@
|
|||||||
name: softvowels
|
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:
|
services:
|
||||||
db:
|
softvowels-db:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
|
container_name: softvowels-db
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: payload
|
POSTGRES_USER: payload
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
POSTGRES_DB: softvowels
|
POSTGRES_DB: softvowels
|
||||||
volumes:
|
volumes:
|
||||||
- pgdata:/var/lib/postgresql/data
|
- softvowels-pgdata:/var/lib/postgresql/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U payload -d softvowels"]
|
test: ["CMD-SHELL", "pg_isready -U payload -d softvowels"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
@@ -18,18 +38,19 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- nginx_proxy_manager
|
- nginx_proxy_manager
|
||||||
|
|
||||||
cms:
|
softvowels-cms:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: ./apps/cms/Dockerfile
|
dockerfile: ./apps/cms/Dockerfile
|
||||||
|
container_name: softvowels-cms
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
softvowels-db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
environment:
|
environment:
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
PORT: 3000
|
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_SECRET: ${PAYLOAD_SECRET}
|
||||||
PAYLOAD_PUBLIC_SERVER_URL: https://${CMS_HOSTNAME}
|
PAYLOAD_PUBLIC_SERVER_URL: https://${CMS_HOSTNAME}
|
||||||
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_URL: http://host.docker.internal:4321/__revalidate
|
||||||
ASTRO_REVALIDATE_TOKEN: ${REVALIDATE_TOKEN}
|
ASTRO_REVALIDATE_TOKEN: ${REVALIDATE_TOKEN}
|
||||||
volumes:
|
volumes:
|
||||||
- cms-uploads:/app/apps/cms/media
|
- softvowels-cms-uploads:/app/apps/cms/media
|
||||||
networks:
|
networks:
|
||||||
- nginx_proxy_manager
|
- nginx_proxy_manager
|
||||||
|
|
||||||
@@ -46,11 +67,12 @@ services:
|
|||||||
# ./apps/web/dist on the host, and we mount that path into nginx. That way
|
# ./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
|
# publishing in /admin → new content is live within ~30-60s without any
|
||||||
# docker build / image push step.
|
# docker build / image push step.
|
||||||
web:
|
softvowels-web:
|
||||||
image: nginx:1.27-alpine
|
image: nginx:1.27-alpine
|
||||||
|
container_name: softvowels-web
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
- cms
|
- softvowels-cms
|
||||||
volumes:
|
volumes:
|
||||||
- ./apps/web/dist:/usr/share/nginx/html:ro
|
- ./apps/web/dist:/usr/share/nginx/html:ro
|
||||||
- ./apps/web/nginx-default.conf:/etc/nginx/conf.d/default.conf:ro
|
- ./apps/web/nginx-default.conf:/etc/nginx/conf.d/default.conf:ro
|
||||||
@@ -58,9 +80,8 @@ services:
|
|||||||
- nginx_proxy_manager
|
- nginx_proxy_manager
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
pgdata:
|
softvowels-pgdata:
|
||||||
cms-uploads:
|
softvowels-cms-uploads:
|
||||||
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
nginx_proxy_manager:
|
nginx_proxy_manager:
|
||||||
|
|||||||
Reference in New Issue
Block a user