Update testing docker stuff

This commit is contained in:
askiiart 2023-09-05 20:42:40 -05:00
parent 359c237d15
commit 64278c0022
No known key found for this signature in database
GPG key ID: 85505F3A2264FA01
3 changed files with 11 additions and 4 deletions

View file

@ -52,7 +52,7 @@ autogen enables or disables the bot's automatic production of homebrew content.
Example `docker run`: Example `docker run`:
```bash ```bash
docker run -d -v /path/to/.env:/data/.env docker.askiiart.net/askiiart/discord-always-dungeons docker run -d --env-file /path/to/.env docker.askiiart.net/askiiart/discord-always-dungeons
``` ```
Example `docker-compose.yml`: Example `docker-compose.yml`:
@ -62,8 +62,8 @@ version: '3.7'
services: services:
hugo: hugo:
image: docker.askiiart.net/askiiart/discord-always-dungeons image: docker.askiiart.net/askiiart/discord-always-dungeons
volumes: env_file:
- /path/to/.env:/data/.env - /path/to/.env
``` ```
## Build the Docker image ## Build the Docker image
@ -75,4 +75,12 @@ git apply docker.patch
docker build . docker build .
``` ```
## Run the dev image
This image is built for development. It mounts the current directory to /data, installs all the dependencies, and runs the bot from there. Keep in mind this runs differently than the production image. It uses load_dotenv, not `--env-file`.
```bash
docker run -v .:/data docker.askiiart.net/askiiart/always-dungeons-testing
```
Alternatively, you can just run `./build-and-push.sh`, which will apply the patch, build the image, and push it to the registry. Just make sure to fix the variables before running it. Alternatively, you can just run `./build-and-push.sh`, which will apply the patch, build the image, and push it to the registry. Just make sure to fix the variables before running it.

View file

@ -1,6 +1,5 @@
#!/bin/bash #!/bin/bash
set -e set -e
git clone https://github.com/7trail/AlwaysDungeons
pip3 install -r /data/AlwaysDungeons/requirements.txt pip3 install -r /data/AlwaysDungeons/requirements.txt
cp /data/.env /data/AlwaysDungeons/.env cp /data/.env /data/AlwaysDungeons/.env
cd /data/AlwaysDungeons cd /data/AlwaysDungeons