Fix readme and script

This commit is contained in:
askiiart 2023-09-06 15:17:36 -05:00
parent df04e4afbf
commit b40e26554c
2 changed files with 11 additions and 4 deletions

View file

@ -72,9 +72,12 @@ Run this to build the image:
```bash
git apply docker.patch
docker run -v .:/repo python /bin/sh -c "cd /repo && pip install -r requirements.txt && apt-get update && apt-get install binutils -y && pip install pyinstaller && pyinstaller main.py && cd /repo/dist/main && chmod -R 777 /repo/dist/main && tar cvfz /repo/AlwaysDungeons.tar.gz *"
docker build .
```
Alternatively, you can just run `./build-and-push.sh`, which will do all that for you. Just make sure to set the variables before running it.
## 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`.
@ -91,5 +94,3 @@ services:
volumes:
- .:/data
```
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,7 +1,9 @@
#!/usr/bin/env bash
set -e
# ORG and NAME aren't used unless push is enabled.
ORG="askiiart"
NAME="discord-always-dungeons"
PUSH="false"
# Apply patch for Docker
git apply docker.patch
@ -11,5 +13,9 @@ docker run -v .:/repo python /bin/sh -c "cd /repo && pip install -r requirements
ID=$(docker build . -q)
# Could just do -t on the build, but this makes it easier to expand if needed.
docker tag ${ID} ${ORG}/${NAME}:latest
docker push ${ORG}/${NAME}:latest
if [ $ID == "true" ]; then
docker tag ${ID} ${ORG}/${NAME}:latest
docker push ${ORG}/${NAME}:latest
else
echo Docker image ID: $ID
fi