Fix readme and script
This commit is contained in:
parent
df04e4afbf
commit
b40e26554c
2 changed files with 11 additions and 4 deletions
|
@ -72,9 +72,12 @@ Run this to build the image:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
git apply docker.patch
|
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 .
|
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
|
## 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`.
|
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:
|
volumes:
|
||||||
- .:/data
|
- .:/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.
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -e
|
set -e
|
||||||
|
# ORG and NAME aren't used unless push is enabled.
|
||||||
ORG="askiiart"
|
ORG="askiiart"
|
||||||
NAME="discord-always-dungeons"
|
NAME="discord-always-dungeons"
|
||||||
|
PUSH="false"
|
||||||
|
|
||||||
# Apply patch for Docker
|
# Apply patch for Docker
|
||||||
git apply docker.patch
|
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)
|
ID=$(docker build . -q)
|
||||||
|
|
||||||
# Could just do -t on the build, but this makes it easier to expand if needed.
|
# Could just do -t on the build, but this makes it easier to expand if needed.
|
||||||
|
if [ $ID == "true" ]; then
|
||||||
docker tag ${ID} ${ORG}/${NAME}:latest
|
docker tag ${ID} ${ORG}/${NAME}:latest
|
||||||
docker push ${ORG}/${NAME}:latest
|
docker push ${ORG}/${NAME}:latest
|
||||||
|
else
|
||||||
|
echo Docker image ID: $ID
|
||||||
|
fi
|
Loading…
Reference in a new issue