-
Notifications
You must be signed in to change notification settings - Fork 73
Deployment
Jonathan Sharpe edited this page Aug 25, 2024
·
11 revisions
A Dockerfile
is already provided, you can docker build --tag <your tag> .
and create a production-ready image.
To deploy to GAE you will need to add the following to scripts
in package.json
:
"e2e:dev:e2e": "cross-env PLAYWRIGHT_BASE_URL=http://localhost:3000 npm run e2e",
+ "gcp-build": "npm run build && npm --workspace api prune --omit dev",
"lint": "npm run lint:eslint . && npm run lint:prettier -- --check .",
and add a app.yaml
as follows:
# For deployment on Google App Engine, see:
# https://cloud.google.com/appengine/docs/standard/reference/app-yaml?tab=node.js
---
runtime: nodejs20
instance_class: F1
entrypoint: node api/server.js
env_variables:
LOG_LEVEL: info
automatic_scaling:
max_instances: 1
For deployment to Heroku, you can add the following app.json
(note: uses free dyno but requires $5/mo for the DB):
{
"name": "<name>",
"description": "<description>",
"stack": "heroku-24",
"addons": ["heroku-postgresql:essential-0"],
"buildpacks": ["heroku/nodejs"],
"env": {
"LOG_LEVEL": {
"description": "Level of outputs to show in logs",
"value": "info"
}
},
"success_url": "/"
}
Once you've committed and pushed that file, visit https://www.heroku.com/deploy?template=https://github.com/<owner>/<repo>
to deploy.
For deployment to Render, you will need a render.yaml
like the following:
---
services:
- type: web
plan: free
name: starter-kit
region: frankfurt
env: node
buildCommand: npm ci --include dev; npm run build; npm prune --omit dev
startCommand: npm start
healthCheckPath: /healthz
envVars:
- key: DATABASE_URL
fromDatabase:
name: psql
property: connectionString
- key: LOG_LEVEL
value: info
- key: NODE_ENV
value: production
databases:
- name: psql
region: frankfurt
databaseName: cyf
plan: free
ipAllowList: [] # only allow internal connections
For deployment to Vercel, you will need a vercel.json
like the following:
{
"buildCommand": "npm run build",
"installCommand": "npm install",
"outputDirectory": "api/static",
"regions": ["fra1"],
"rewrites": [{ "source": "/api/(.*)", "destination": "/api/app" }]
}