From 1ae3ef7a03cd0e8661325b2f9e83753e79c1d4a1 Mon Sep 17 00:00:00 2001 From: MrTuxedo Date: Sun, 23 Apr 2023 11:31:11 -0700 Subject: [PATCH] pass env vars through docker-compose.yml --- README.md | 4 ++-- docker-compose.yml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a921dbe..2e3ec57 100644 --- a/README.md +++ b/README.md @@ -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= @@ -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. diff --git a/docker-compose.yml b/docker-compose.yml index 2df4844..4a7ccc2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -23,6 +23,9 @@ services: - 1.1.1.1 environment: - NODE_ENV=production + - DISCORD_BOT_TOKEN + - DISCORD_CLIENT + - RPC_URL restart: unless-stopped volumes: