diff --git a/.drone.yml b/.drone.yml index 1105a75..f5da89b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,6 +2,11 @@ kind: pipeline name: default steps: +- name: Remove extra stuff to make Docker images lighter + image: alpine:latest + commands: + - apk add git + - cd /drone/src && git apply docker.patch - name: build and publish image: plugins/docker pull: always diff --git a/README.md b/README.md index be019ad..915381f 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,11 @@ services: ## Build the Docker image -Just run `docker build .` +Run this to build the image: -Alternatively, you can just run `./build-and-push.sh`, which will build the image and push it to the registry. Just make sure to fix the variables before running it. +```bash +git apply docker.patch +docker build . +``` + +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. diff --git a/build-and-push.sh b/build-and-push.sh index fc600e3..2e3b850 100755 --- a/build-and-push.sh +++ b/build-and-push.sh @@ -4,6 +4,9 @@ ORG="askiiart" NAME="discord-always-dungeons" ID=$(docker build . -q) +# Apply patch for Docker +git apply docker.patch + # 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 diff --git a/docker.patch b/docker.patch new file mode 100644 index 0000000..99bf17f --- /dev/null +++ b/docker.patch @@ -0,0 +1,57 @@ +From 0974f832051eb8fc80d055b3654d59307da28ccd Mon Sep 17 00:00:00 2001 +From: askiiart +Date: Tue, 5 Sep 2023 20:05:01 -0500 +Subject: [PATCH] Lighten Docker stuff + +--- + generate.py | 2 -- + main.py | 3 --- + requirements.txt | 3 +-- + 3 files changed, 1 insertion(+), 7 deletions(-) + +diff --git a/generate.py b/generate.py +index fa9cc80..5746646 100644 +--- a/generate.py ++++ b/generate.py +@@ -1,7 +1,5 @@ + from poe_api_wrapper import PoeApi + import os +-from dotenv import load_dotenv +-load_dotenv() + client = PoeApi(os.environ['POE_TOKEN']) + import asyncio + +diff --git a/main.py b/main.py +index 36d3473..943aaaa 100644 +--- a/main.py ++++ b/main.py +@@ -1,5 +1,4 @@ + import os +-from dotenv import load_dotenv + import discord + import generate + import neural +@@ -9,8 +8,6 @@ import re + from discord import app_commands + from discord.ext import tasks + +-load_dotenv() +- + client = discord.Client(intents=discord.Intents.all()) + tree = app_commands.CommandTree(client) + +diff --git a/requirements.txt b/requirements.txt +index b8d92fd..970bcec 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -2,5 +2,4 @@ discord + Pillow + requests + revChatGPT +-poe-api-wrapper +-python-dotenv ++poe-api-wrapper +\ No newline at end of file +-- +2.41.0 +