pass env vars through docker-compose.yml

This commit is contained in:
MrTuxedo 2023-04-23 11:31:11 -07:00
parent 3a9c68f21c
commit 1ae3ef7a03
2 changed files with 5 additions and 2 deletions

View File

@ -18,7 +18,7 @@ This repo contains Docker build files for a Discord bot built with Node.js and u
git clone https://git.ssh.surf/MrTuxedo/gwei-alert-bot.git
```
2. Add the following environment variables to the runtime container via `docker-compose.yml`:
2. Create a .env file in the root of the project and add the following environment variables:
```makefile
RPC_URL=<your rpc url>
@ -54,7 +54,7 @@ docker compose up -d --build
## Environment Variables
The following environment variables must be set in `docker-compose.yml` in order for the bot to function properly:
The following environment variables must be set in either `.env` or `docker-compose.yml` in order for the bot to function properly:
- RPC_URL: Your RPC url
- DISCORD_BOT_TOKEN: the Oauth2 token for your Discord bot.

View File

@ -23,6 +23,9 @@ services:
- 1.1.1.1
environment:
- NODE_ENV=production
- DISCORD_BOT_TOKEN
- DISCORD_CLIENT
- RPC_URL
restart: unless-stopped
volumes: