Skip to content

Commit

Permalink
Fix Dockerfile final?
Browse files Browse the repository at this point in the history
  • Loading branch information
minisbett committed Nov 18, 2023
1 parent c084765 commit a9aac23
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ jobs:
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
script: |
echo "$HUIS_BOT_ENV_FILE" > /root/test.txt
docker pull ${{ secrets.DOCKERHUB_USERNAME }}/huisbot:latest
docker stop huisbot
docker rm huisbot
docker run -d --env-file "$HUIS_BOT_ENV_FILE" --name huisbot ${{ secrets.DOCKERHUB_USERNAME }}/huisbot:latest
docker run -d --env-file "/root/huisbot/.env" --name huisbot ${{ secrets.DOCKERHUB_USERNAME }}/huisbot:latest
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ The bot uses an onion-key in order to gain onion-level access to [Huismetbenen](

The current release of this bot (found in the release branch) is automatically being deployed into a Docker image which can be found [here](https://hub.docker.com/repository/docker/minisbett/huisbot/general). Therefore, you'll need to install the Docker Engine onto your system.

In order to setup the bot, you will need to copy the `huisbot/.env.example` file onto your system. After filling out the required environment variables, create an environment variable `HUIS_BOT_ENV_FILE` which contains the absolute path to your .env file. This causes the Docker image to load the environment variables inside into the shell environment before starting the bot.
In order to setup the bot, you will need to copy the `huisbot/.env.example` file onto your system. You will then pass a path to that file when running the docker container. Consider creating a script to automate the following commands.

Here's an example of what the commands can look like:
Here's how you can download and run the bot:
```sh
# Pulls the latest Huisbot Docker image from Docker Hub.
docker pull minisbett/huisbot:latest
Expand All @@ -21,7 +21,7 @@ docker stop huisbot
docker docker rm huisbot

# Runs the docker container.
docker run -d --env-file "$HUIS_BOT_ENV_FILE" --name huisbot minisbett/huisbot:latest
docker run -d --env-file "/path/to/.env" --name huisbot minisbett/huisbot:latest
```

If you wish to access the console, you can do that with `docker logs huisbot`.
Expand Down
2 changes: 1 addition & 1 deletion huisbot/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ static Program()

public static async Task Main(string[] args)
{
// Load the .env file.
// Load the .env file. (Only useful when debugging locally, not when running it via e.g. Docker)
DotEnv.Load();

// Ensure a consistent culture for parsing & formatting.
Expand Down

0 comments on commit a9aac23

Please sign in to comment.