Update docker stuff to make images a tad lighter
This commit is contained in:
parent
18c12d2d6a
commit
359c237d15
4 changed files with 72 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
57
docker.patch
Normal file
57
docker.patch
Normal 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
|
||||
|
Loading…
Reference in a new issue