# frame-deploy Docker Compose setup for the full Frame stack: - **frame-backend** — Go REST API (auth, users, posts) - **frame-cms** — React/Nginx admin frontend - **postgres** — PostgreSQL 18 --- ## Quick Start ### 1. Clone this repo ```bash git clone https://git.beatrice.wtf/panic.haus/frame-deploy cd frame-deploy ``` ### 2. Configure ```bash cp backend.env.example backend.env ``` Edit `backend.env` and at minimum set: | Variable | What to change | |---|---| | `DATABASE_URL` | Leave as-is (points to the `postgres` service) | | `JWT_SECRET` | **Change this in production** | | `CORS_ALLOWED_ORIGINS` | URL where frame-cms will be served | | `FRONTEND_BASE_URL` | Same URL (used in email links) | | `SMTP_*` | Optional — needed for email verification | ### 3. Pull images and start ```bash docker compose pull docker compose up -d ``` Services will be available at: - **CMS:** http://localhost:3000 - **API:** http://localhost:8080 --- ## Runtime environment variables Both CMS variables are injected at container startup — **no image rebuild needed**. ### frame-cms | Variable | Default | Description | |---|---|---| | `VITE_API_BASE_URL` | `http://localhost:8080` | URL of the backend API as seen by the browser | | `VITE_BASE_URL` | `/` | Base path where the CMS is served | | `CMS_PORT` | `3000` | Host port for the CMS container | ### frame-backend | Variable | Default | Description | |---|---|---| | `BACKEND_PORT` | `8080` | Host port for the backend container | ### Subpath deployment example To serve the CMS at `https://frame.example.com/admin` and the API at `https://frame.example.com/api`: ```bash # .env VITE_API_BASE_URL=https://frame.example.com/api VITE_BASE_URL=/admin ``` Then in your reverse proxy, strip `/api` before forwarding to the backend. --- ## Create an admin user (first time only) If SMTP is not configured, email verification won't work — you'll need to manually verify the user in the DB: ```bash docker compose exec postgres psql -U postgres -d appdb \ -c "UPDATE users SET email_verified = true WHERE email = 'your@email.com';" ``` --- ## Data persistence Postgres data is stored in `./data/postgres/` (relative to this directory). This folder is gitignored — back it up separately. --- ## Updating ```bash docker compose pull docker compose up -d ``` --- ## Stopping ```bash docker compose down # stop, keep data docker compose down -v # stop + remove volumes (destructive) ```