Skip to content

Commit

Permalink
Introduce Docker + Build Action
Browse files Browse the repository at this point in the history
  • Loading branch information
lorddusk committed Mar 16, 2024
1 parent 5187f27 commit 17c5e2a
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 16 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
venv
.env
secret.key
forever.py
testbot.py
cogsToBeDetermined/poll.py
cogs/kta.py
30 changes: 30 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build Docker Container

on:
push:
branches:
- main
- master

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v4
with:
push: true
tags: lorddusk/schedulecrawler:latest
File renamed without changes.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM python:3.9-slim-bookworm
LABEL authors="Dusk"
WORKDIR /app
COPY requirements.txt ./
RUN apt-get update && apt-get install -y git
RUN pip install -U -r requirements.txt
COPY . .
CMD ["python", "./bot.py"]
11 changes: 5 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
requests~=2.20.0
motor~=2.3.0
environs~=8.0.0
aiohttp~=3.6.3
requests>=2.31.0
motor>=3.2.0
aiohttp>=3.8.0
environs>=8.0.0
cryptography
discord-components
pytz~=2021.1
dateparser~=1.0.0
parsedatetime~=2.6
git+https://github.com/CrawlerEmporium/CrawlerUtilities.git
discord.py
py-cord>=2.4.1
python-dateutil~=2.8.1
17 changes: 7 additions & 10 deletions utils/globals.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import motor.motor_asyncio
from environs import Env
import os
from crawler_utilities.handlers.logger import Logger

log = Logger("logs", "ScheduleCrawler", "ScheduleCrawler").logger

env = Env()
env.read_env()

PREFIX = env('PREFIX')
TOKEN = env('TOKEN')
COGS = env('COGS')
COGSEVENTS = env('COGSEVENTS')
OWNER = int(env('OWNER'))
MONGODB = env('MONGODB')
PREFIX = os.environ['PREFIX']
TOKEN = os.environ['TOKEN']
COGS = os.environ['COGS']
COGSEVENTS = os.environ['COGSEVENTS']
OWNER = int(os.environ['OWNER'])
MONGODB = os.environ['MONGODB']

BOT = 856591849825239090
PM_TRUE = True
Expand Down

0 comments on commit 17c5e2a

Please sign in to comment.