Dockerize PWSBot

This commit is contained in:
whitney 2024-05-16 14:01:00 -07:00
parent 23d990fd99
commit 4ce5873711
6 changed files with 11 additions and 12 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
env/
pwsBot/commands/__pycache__/
pwsBot/resource/__pycache__/
token.json
pwsBot/resource/token.json

View File

@ -1,11 +1,11 @@
FROM python:3.11
WORKDIR /discord
WORKDIR /app
COPY ./ /discord
COPY bot.py requirements.txt ./
COPY resource/ ./resource
COPY commands/ ./commands
EXPOSE 3000
WORKDIR /discord
RUN pip install --no-cache-dir -r requirements.txt
CMD [ "python", "bot.py" ]

View File

@ -15,7 +15,7 @@ pws_command_with_args_regex = r'/pws \S+(.*)'
intents = get_intents()
client = discord.Client(intents=intents)
client_token = get_token('../token.json')
client_token = get_token('resource/token.json')
@client.event
async def on_ready():

View File

View File

@ -1,10 +1,8 @@
version: "3"
version: "3.8"
services:
website:
image: pwsBot:latest
pwsBot:
image: pwsbot:latest
container_name: pwsBot
build: .
ports:
- 8000:8000

1
pwsBot/requirements.txt Normal file
View File

@ -0,0 +1 @@
discord.py==2.3.2