Yeti Jobs ships with Docker support for the Express backend, letting you package the Node.js server and its dependencies into a reproducible image that runs identically on any machine or cloud VM. The build uses a two-stage Dockerfile to keep the final image lean — dev dependencies are installed only during the build stage and are not carried into the production image.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tech-dipesh/yeti-Jobs/llms.txt
Use this file to discover all available pages before exploring further.
Only the backend is fully containerised at this time. The frontend is a static Vite build that is deployed separately (e.g. Vercel), and the PostgreSQL database is expected to be an external service (local Postgres or Supabase). Partial Dockerization of the full stack via
compose.yml is described at the end of this page.Backend Dockerfile
The followingDockerfile lives at backend/Dockerfile. It uses a multi-stage build:
backend/Dockerfile
Stage breakdown
| Stage | Base image | Purpose |
|---|---|---|
builder | node:20-alpine | Installs all dependencies (including devDependencies) and runs any build steps |
| Final (unnamed) | node:20-alpine | Installs production-only dependencies (--omit=dev) and copies the built artefacts |
COPY package*.json ./+RUN npm ci— installs a clean, deterministic dependency tree frompackage-lock.json.RUN npm run dev || true— runs any build-time scripts; the|| trueensures the stage does not fail if there is nothing to compile.RUN npm ci --omit=dev— re-installs only production packages in the final stage, keeping the image size down.COPY --from=builder— cherry-picks only the files the server needs:src/,server.js,db/, and.env.EXPOSE 3000— documents the port; map it with-patdocker runtime.CMD ["sh", "-c", "node db/migrate.js && node server.js"]— runs database migrations first, then starts the server.
The
COPY --from=builder /app/.env ./.env instruction copies your local .env into the image. This is convenient for development but means the image contains secrets. For production, remove this line and inject variables at runtime using --env-file or your orchestrator’s secrets management.Build and Run
Create your backend .env file
Before building, make sure
backend/.env exists and contains all required variables. See the Environment Variables reference for the full list.Build the Docker image
Run this command from inside the The build will take a minute on the first run while npm downloads packages. Subsequent builds are faster thanks to layer caching.
backend/ directory. The -t flag tags the image as yeti-jobs-backend.Run the container
Start the container in detached mode (
-d), mapping host port 3000 to the container’s port 3000, and injecting environment variables from your local .env file.| Flag | Purpose |
|---|---|
-d | Run in the background (detached) |
-p 3000:3000 | Expose the server on localhost:3000 |
--env-file .env | Inject all variables from your .env without baking them into the image |
--name yeti-jobs-backend | Give the container a friendly name for docker stop/docker logs |
Verify the server is running
Tail the container logs to confirm the server and database connection started successfully.You should see:Then hit the health endpoint:
Database connectivity
The backend container does not include PostgreSQL. Thepg.Pool inside src/db.js connects to whichever host is referenced in DATABASE_PASSWORD (your connection string). Point this at:
- A local Postgres instance:
postgresql://postgres:password@host.docker.internal:5432/yeti_jobs— usehost.docker.internalinstead oflocalhostso the container can reach the host machine’s network. - A cloud-hosted Supabase database: use the Supabase connection pooler URL (port
6543). See Deploy to Vercel & Render for details.
Docker Compose (full local stack)
Acompose.yml at the repository root orchestrates all three services — PostgreSQL, the backend, and the frontend — on a shared bridge network. This is the fastest way to spin up the entire application locally without installing Node or Postgres directly.
compose.yml
.env file in the repository root. Create one by merging your backend and frontend variables:
| Service | Local address |
|---|---|
| Frontend (Vite / serve) | http://localhost:5173 |
| Backend (Express) | http://localhost:3000 |
| PostgreSQL | localhost:5432 |
Frontend Dockerfile (reference)
The frontend also ships with its own multi-stage Dockerfile atfrontend/Dockerfile, used by Compose:
frontend/Dockerfile
dist/ output with the serve package on port 5173.