feat(deploy): app stack + manual Portainer deploy workflow
Add the missing api/web deployment path on top of the existing image build CI. - deploy/jorgecuadros-app.stack.yml: PROD app stack (api + web) pulling the git.mancinas.io registry images. Does not ship mysql/minio (separate stacks); API reaches them via DATABASE_URL / S3_ENDPOINT. API pinned to the jorgecuadros_db node for stable ingest/backup volumes; web is stateless. - deploy/jorgecuadros-app.env.example: documented stack env template. - .gitea/workflows/deploy.yml: manual (workflow_dispatch) deploy to Portainer via cssnr/portainer-stack-deploy-action. Inputs: image tag + scope (app = web+api, full = db+minio+app, applied db->minio->app). Make the web API origin runtime-configurable instead of build-baked: the root layout injects window.__API_ORIGIN__ from the API_ORIGIN env (force-dynamic) and lib/api.ts resolves it at runtime, so one built image serves any deployment. Also: dev.sh to run both dev servers (frees stale ports first) and move local dev to ports web 4500 / api 4501. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
# Stack env for deploy/jorgecuadros-app.stack.yml (PROD).
|
||||
# Paste these into the Portainer stack's "Environment variables" at deploy time.
|
||||
# Do NOT commit real secrets — this file is a template only.
|
||||
#
|
||||
# HOST below = the swarm host the db/minio/app stacks publish on (cubex).
|
||||
|
||||
# Which built image tag to run. latest = default-branch build; or pin sha-<x> / vX.Y.Z.
|
||||
APP_TAG=latest
|
||||
|
||||
# --- Public URLs (what the end user's BROWSER hits) ---------------------------
|
||||
# API_ORIGIN is injected into the web app at runtime and used for browser fetches
|
||||
# + document download links, so it must be browser-reachable (not swarm-internal).
|
||||
# WEB_ORIGIN is the web app's own public origin; the API allows it via CORS.
|
||||
API_ORIGIN=http://192.168.4.212:3001
|
||||
WEB_ORIGIN=http://192.168.4.212:3000
|
||||
|
||||
# Published ports on the swarm host.
|
||||
API_PORT=3001
|
||||
WEB_PORT=3000
|
||||
|
||||
# --- Database (points at the jorgecuadros-prod-db stack) ----------------------
|
||||
# prod db publishes 3306 on the host (see deploy/jorgecuadros-db.stack.yml).
|
||||
DATABASE_URL=mysql://jorgecuadros:CHANGE_ME@192.168.4.212:3306/jorgecuadros
|
||||
|
||||
# --- Auth --------------------------------------------------------------------
|
||||
# 64-hex random. Generate: openssl rand -hex 32
|
||||
SESSION_SECRET=CHANGE_ME
|
||||
|
||||
# --- Object storage (points at the jorgecuadros-prod-minio stack) -------------
|
||||
# Server-side only; prod minio API publishes 9000 on the host.
|
||||
S3_ENDPOINT=http://192.168.4.212:9000
|
||||
S3_BUCKET=jorgecuadros-documents
|
||||
MINIO_ROOT_USER=jc_minio
|
||||
MINIO_ROOT_PASSWORD=CHANGE_ME
|
||||
Reference in New Issue
Block a user