v 0.1.96

Deployment

Deploying an Ecopages application depends on whether you are using only static features or if you've added API routes and server-side logic.

Production Build

Before deploying, you must create a production build. This processes your assets, pre-renders static pages, and prepares the .eco directory.

bun run build

This command will:

  1. Set NODE_ENV=production.
  2. Clean the .eco directory.
  3. Generate static HTML for all files in src/pages.
  4. Process images and CSS.
  5. Collect all necessary server-side files.

Static Hosting

If your site does not use API routes or programmatic server logic, you can host the contents of the .eco/public (or similar output) directory on any static provider.


Server Hosting (Node/Bun)

If your application uses API routes or dynamic server logic, you need a runtime environment that supports Bun.

1. Using bun run start

After building, you can start the production server:

bun run start

2. Docker Deployment

You can easily containerize your Ecopages app using the official Bun image.

FROM oven/bun:latest
 
WORKDIR /app
 
COPY package.json bun.lockb ./
RUN bun install --production
 
COPY . .
RUN bun run build
 
EXPOSE 3000
CMD ["bun", "run", "start"]

3. VPS / PaaS (Railway, Fly.io)

Deploy the server by pointing the platform to your app.ts as the entry point and ensuring it runs with the start command in production.


Environment Check

Before going live, check that these environment variables are set on your hosting provider:

VariableRecommended Value
NODE_ENVproduction
ECOPAGES_BASE_URLYour production domain (e.g., https://example.com)
ECOPAGES_PORTThe port required by your host (e.g., 8080)
ECOPAGES_HOSTNAME0.0.0.0 (for Docker/Cloud environments)