Most beginner tutorials end right before the hard part: getting the thing live. Here's the short version of what I'd do for a first Node + Postgres deploy.
- Add a
/healthroute first, so you can tell the app is up. - Read all config from environment variables. Commit
.env.example, never.env. - Containerize it:
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
EXPOSE 3000
CMD ["node","server.js"]
- Use a managed Postgres and set
DATABASE_URLon your host. - Run CI on every push, and deploy only from
main. - Write down your rollback step before you need it.
What part of deploying trips you up most? Tell me in the comments and I'll answer.
I put this into a full handbook with an API checklist, boilerplate snippets, cheat sheets and deployment checklists. It's a founding-member edition, so buyers get updates as it grows: https://modern-full-stack-survival-handbook.whop.site
Top comments (0)