Skip to content

chore(deploy): provision D1 targets config [D1]#2

Merged
Taleef7 merged 5 commits into
mainfrom
d1/deploy-provisioning
May 2, 2026
Merged

chore(deploy): provision D1 targets config [D1]#2
Taleef7 merged 5 commits into
mainfrom
d1/deploy-provisioning

Conversation

@Taleef7

@Taleef7 Taleef7 commented May 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • add root .env.example for all DEPLOY.md variables
  • add Fly app config for workwell-measure-studio-api at 512MB in ord
  • document D1 no-deploy setup, D2 deploy gate, and Neon PG16 requirement

Provisioning evidence

  • Fly app created: workwell-measure-studio-api.fly.dev; no deploy performed
  • Fly secrets list currently has only SPRING_PROFILES_ACTIVE staged; DB secrets removed because Neon CLI created PG17 by default
  • Vercel project created/linked locally as workwell-measure-studio; Production and Development env vars set

Blockers

  • Neon final DB must be recreated as PostgreSQL 16 via Console/API/toolkit; neonctl defaulted to PostgreSQL 17
  • Vercel GitHub connection failed until the Vercel GitHub app/repo permission is granted, so Preview env vars/auto-deploy are pending
  • ANTHROPIC_API_KEY was not present locally, so Fly secret is pending

Verification

  • backend: .\gradlew.bat test -> BUILD SUCCESSFUL
  • git diff --check -> exit 0
  • Fly launch validated backend/fly.toml

Copilot AI review requested due to automatic review settings May 2, 2026 21:00

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 87bd323540

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .env.example
Comment on lines +5 to +6
DATABASE_URL=
DATABASE_URL_DIRECT=

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Set Fly secrets with Spring datasource variable names

The deployment template uses DATABASE_URL/DATABASE_URL_DIRECT, but this backend reads datasource settings from spring.datasource.* (backend/src/main/resources/application.yml), and there is no mapping from DATABASE_URL to those properties. In a Fly deploy that follows this config, the app will keep the default jdbc:postgresql://localhost:5432/workwell and fail to connect to Neon in production. Use SPRING_DATASOURCE_URL/SPRING_DATASOURCE_USERNAME/SPRING_DATASOURCE_PASSWORD (and Flyway-specific keys if needed) or explicitly bind DATABASE_URL in Spring config.

Useful? React with 👍 / 👎.

Comment thread backend/fly.toml
primary_region = 'ord'

[build]
dockerfile = '../infra/backend.Dockerfile'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Align Fly build context with backend Dockerfile assumptions

This dockerfile path points to ../infra/backend.Dockerfile, but that Dockerfile expects repo-root context (COPY backend/ ./ in infra/backend.Dockerfile). Fly's own config docs state that setting build.dockerfile does not change build context; with the documented cd backend workflow, deploy builds from backend/ and COPY backend/ will fail because that path is outside the context. Configure deploy from repo root (or set an explicit working directory) or rewrite the Dockerfile to copy from the backend context.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds initial deployment/provisioning scaffolding and documentation for the Vercel + Fly.io + Neon + Anthropic stack, including environment variable templates and Fly app configuration for the backend.

Changes:

  • Added docs/DEPLOY.md with D1 provisioning steps and deployment notes for Neon/Fly/Vercel/Anthropic.
  • Added backend/fly.toml for a new Fly app (workwell-measure-studio-api) with health checks and 512MB sizing.
  • Added root .env.example and updated .gitignore to commit the template while keeping real env files ignored.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 9 comments.

File Description
docs/DEPLOY.md New deployment guide covering provisioning, env vars, CI/CD notes, and troubleshooting.
backend/fly.toml Fly.io app config (build, env, HTTP service, health check, VM sizing).
.gitignore Ensures .env.example is not ignored while .env* remains ignored.
.env.example Adds a committed template for required Fly/Vercel environment variables.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/DEPLOY.md Outdated
Comment thread docs/DEPLOY.md
Dashboard → Deployments → previous → Promote to Production.

### Neon
Each schema migration creates a branch. Promote previous branch to main from Neon dashboard.
Comment thread docs/DEPLOY.md
Comment on lines +162 to +165
**MCP server can't be reached**
- MCP runs as separate process or endpoint (`/mcp`)
- Check Fly machine has port exposed if using stdio over HTTP
- Verify Claude Desktop config points to deployed URL
Comment thread docs/DEPLOY.md Outdated
Comment thread docs/DEPLOY.md

- Backend: `GET /actuator/health` → `{"status":"UP"}`
- Frontend: `GET /` → 200 OK
- DB: from Fly machine, `fly ssh console` → `psql $DATABASE_URL_DIRECT -c "SELECT 1"`
Comment thread docs/DEPLOY.md
fly secrets set DATABASE_URL=<neon-pooled>
fly secrets set DATABASE_URL_DIRECT=<neon-direct>
fly secrets set ANTHROPIC_API_KEY=<key>
fly secrets set SPRING_PROFILES_ACTIVE=prod
Comment thread backend/fly.toml
Comment thread backend/fly.toml Outdated
Comment thread docs/DEPLOY.md
Comment on lines +41 to +45
```bash
cd backend
fly launch --no-deploy
fly secrets set DATABASE_URL=<neon-pooled>
fly secrets set DATABASE_URL_DIRECT=<neon-direct>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@vercel

vercel Bot commented May 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
workwell-measure-studio Ready Ready Preview, Comment May 2, 2026 9:29pm

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Taleef7 and others added 2 commits May 2, 2026 17:28
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Taleef7 Taleef7 merged commit e294c03 into main May 2, 2026
4 checks passed
@Taleef7 Taleef7 deleted the d1/deploy-provisioning branch May 2, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants