VPS
Example of vps deploy with infra split from business. Keeps one mysql instance for all.
This commit is contained in:
6 files changed
+359
No files matched your search
@@ -0,0 +1,63 @@
|
||||
name: next-chair-marios
|
||||
|
||||
# One business's app container on the shared multi-business VPS setup —
|
||||
# see docker-compose.infra.yaml for the shared MySQL/Traefik this attaches
|
||||
# to, and that file's header for the exact one-time setup steps (create
|
||||
# this business's database, copy .env.business.example) needed before
|
||||
# this file can start.
|
||||
#
|
||||
# docker compose -f docker-compose.marios.yaml --env-file .env.business.marios up -d --build
|
||||
#
|
||||
# `docker-compose.blake-heritage.yaml` is the identical shape for the
|
||||
# first business — copy this file's pattern again for any future business.
|
||||
|
||||
services:
|
||||
next-chair-marios:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
# Builds the image fresh here. Once there are more than a couple of
|
||||
# businesses, it's worth building once (`docker build -t
|
||||
# nextchair-app:latest .`) and swapping this `build:` block for
|
||||
# `image: nextchair-app:latest` in every business's file instead, so
|
||||
# a code update doesn't mean rebuilding the identical image N times —
|
||||
# not necessary to start with.
|
||||
container_name: next-chair-marios
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env.business.marios
|
||||
volumes:
|
||||
- next-chair-media-marios:/app/storage/media
|
||||
healthcheck:
|
||||
# No curl/wget in the node:22-alpine base image — a plain Node
|
||||
# request avoids adding a package just for this. See
|
||||
# src/app/api/health/route.ts: healthy as soon as the database is
|
||||
# reachable, even before installation completes.
|
||||
test:
|
||||
[
|
||||
"CMD",
|
||||
"node",
|
||||
"-e",
|
||||
"require('http').get('http://localhost:3000/api/health', r => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))",
|
||||
]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 20s
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.marios.rule=Host(`${DOMAIN}`)"
|
||||
- "traefik.http.routers.marios.entrypoints=websecure"
|
||||
- "traefik.http.routers.marios.tls.certresolver=letsencrypt"
|
||||
- "traefik.http.services.marios.loadbalancer.server.port=3000"
|
||||
networks:
|
||||
- next-chair-edge
|
||||
|
||||
volumes:
|
||||
next-chair-media-marios:
|
||||
name: next-chair-media-marios
|
||||
|
||||
networks:
|
||||
next-chair-edge:
|
||||
name: next-chair-edge
|
||||
external: true
|
||||
Reference in new issue
Block a user