Zeppelin's production environment uses Docker. There are a few different ways to run Zeppelin in production:
- Standalone
- The easiest way to get Zeppelin up and running. This setup comes with a built-in database and web server.
- Lightweight
- In case you don't want to use the built-in database and web server. This setup only runs the bot, API, and dashboard themselves. You'll have to provide your own database connection options and set up a proxy server for the API and dashboard.
- Manual
- If you only want to run a specific service, you can use Zeppelin's Dockerfile directly.
- Install Docker on the machine running the bot
- Make a copy of
.env.example
called.env
- Fill in the missing values in
.env
(including the "PRODUCTION - STANDALONE" section)
Note: The dashboard and API are served insecurely over HTTP. It is recommended to set up a proxy with a TLS certificate in front of them. A popular option for this is Cloudflare Tunnel.
docker compose -f docker-compose.standalone.yml up -d
docker compose -f docker-compose.standalone.yml down
- Shut the bot down
- Update the files (e.g.
git pull
) - Rebuild:
docker compose -f docker-compose.standalone.yml build
- Run the bot again
docker compose -f docker-compose.standalone.yml logs -t -f
- Install Docker on the machine running the bot
- Make a copy of
.env.example
called.env
- Fill in the missing values in
.env
(including the "PRODUCTION - LIGHTWEIGHT" section)
docker compose -f docker-compose.lightweight.yml up -d
docker compose -f docker-compose.lightweight.yml down
- Shut the bot down
- Update the files (e.g.
git pull
) - Rebuild:
docker compose -f docker-compose.lightweight.yml build
- Run the bot again
docker compose -f docker-compose.lightweight.yml logs -t -f
- Build the Zeppelin image:
docker build --tag 'zeppelin' .
- Run the service:
- Bot:
docker run zeppelin npm run start-bot
- API:
docker run zeppelin npm run start-api
- Dashboard:
docker run zeppelin npm run start-dashboard
If you're using an application platform such as Railway, you can simply point it to Zeppelin's repository and it should pick up the Dockerfile from there.
For the start command, you can use the same commands as above: npm run start-bot
, npm run start-api
, npm run start-dashboard
.
Make sure to also run migrations when you update the bot.
You'll need to provide the necessary env variables in the manual setup. For example, docker run -e NODE_ENV=production --env-file .env zeppelin
The following env variables can be used to set up the database credentials:
DB_HOST
DB_PORT
DB_USER
DB_PASSWORD
DB_DATABASE
The following env variable can be used to configure the API path prefix:
API_PATH_PREFIX
Remember to always set NODE_ENV
to production
for production setups.