3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-14 21:31:50 +00:00
zeppelin/PRODUCTION.md

68 lines
2.7 KiB
Markdown
Raw Normal View History

2022-08-06 22:18:21 +03:00
# Zeppelin production environment
Zeppelin's production environment uses Docker. There are a few different ways to run Zeppelin in production:
2022-08-06 22:18:21 +03:00
1. **Standalone**
* The easiest way to get Zeppelin up and running. This setup comes with a built-in database and web server.
2. **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.
3. **Manual**
* If you only want to run a specific service, you can use Zeppelin's Dockerfile directly.
## Standalone
### Setup
2022-08-06 22:18:21 +03:00
1. Install Docker on the machine running the bot
2. Make a copy of `.env.example` called `.env`
3. Fill in the missing values in `.env` (including the "PRODUCTION - STANDALONE" section)
**Note:** The dashboard and API are exposed with a self-signed certificate. It is recommended to set up a proxy with a proper certificate in front of them. A popular option for this is [Cloudflare Tunnel](https://www.cloudflare.com/products/tunnel/).
### Running the bot
`docker compose -f docker-compose.standalone.yml up -d`
### Shutting the bot down
`docker compose -f docker-compose.standalone.yml down`
### Updating the bot
1. Shut the bot down
2. Update the files (e.g. `git pull`)
3. Rebuild: `docker compose -f docker-compose.standalone.yml build`
4. Run the bot again
### Viewing logs
`docker compose -f docker-compose.standalone.yml logs -t -f`
## Lightweight
2022-08-06 22:18:21 +03:00
### Setup
1. Install Docker on the machine running the bot
2. Make a copy of `.env.example` called `.env`
3. Fill in the missing values in `.env` (including the "PRODUCTION - LIGHTWEIGHT" section)
2022-08-07 13:58:47 +03:00
### Running the bot
`docker compose -f docker-compose.lightweight.yml up -d`
2022-08-06 22:18:21 +03:00
### Shutting the bot down
`docker compose -f docker-compose.lightweight.yml down`
2022-08-06 22:18:21 +03:00
### Updating the bot
1. Shut the bot down
2022-08-06 22:18:21 +03:00
2. Update the files (e.g. `git pull`)
3. Rebuild: `docker compose -f docker-compose.lightweight.yml build`
4. Run the bot again
### Viewing logs
`docker compose -f docker-compose.lightweight.yml logs -t -f`
2022-08-06 22:18:21 +03:00
## Manual
1. Build the Zeppelin image: `docker build --tag 'zeppelin' .`
2. 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`
2022-08-06 22:18:21 +03:00
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`.
2022-08-06 22:18:21 +03:00
**Note:** You'll need to provide the necessary env variables. For example, `docker run --env-file .env zeppelin`