Update docker stuff to make images a tad lighter

This commit is contained in:
askiiart 2023-09-05 20:18:17 -05:00
parent 18c12d2d6a
commit 359c237d15
No known key found for this signature in database
GPG key ID: 85505F3A2264FA01
4 changed files with 72 additions and 2 deletions

View file

@ -2,6 +2,11 @@ kind: pipeline
name: default name: default
steps: 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 - name: build and publish
image: plugins/docker image: plugins/docker
pull: always pull: always

View file

@ -68,6 +68,11 @@ services:
## Build the Docker image ## 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.

View file

@ -4,6 +4,9 @@ ORG="askiiart"
NAME="discord-always-dungeons" NAME="discord-always-dungeons"
ID=$(docker build . -q) 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. # Could just do -t on the build, but this makes it easier to expand if needed.
docker tag ${ID} ${ORG}/${NAME}:latest docker tag ${ID} ${ORG}/${NAME}:latest
docker push ${ORG}/${NAME}:latest docker push ${ORG}/${NAME}:latest

57
docker.patch Normal file
View file

@ -0,0 +1,57 @@
From 0974f832051eb8fc80d055b3654d59307da28ccd Mon Sep 17 00:00:00 2001
From: askiiart <dev@askiiart.net>
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