Skip to content

Commit

Permalink
gemi (dockerize): dockerize the app
Browse files Browse the repository at this point in the history
  • Loading branch information
Akash98Sky committed Jan 13, 2024
1 parent 3df6f61 commit 4b0a66c
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 5 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and Publish Docker Image

on:
push:
branches: [ main, docker ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build-and-publish:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile
push: true
tags: ghcr.io/Akash98Sky/gemi-bot:latest

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Use an official Python runtime as a parent image
FROM python:3.11-slim

RUN apt-get update && apt-get install -y git python3-pyaudio espeak ffmpeg

# Set the working directory in the container
WORKDIR /usr/src/app

# Copy the current directory contents into the container at /usr/src/app
COPY . .

# Install any needed packages specified in requirements.txt
RUN pip install -r requirements.txt

# Make port 8080 available to the world outside this container
EXPOSE 8080

# Run app.py when the container launches
CMD ["gunicorn", "main:web_app", "--bind", "0.0.0.0:8080", "-k", "aiohttp.GunicornWebWorker"]
2 changes: 1 addition & 1 deletion bot/hack.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async def create_sleep_timer(self, delay: int = INACTIVITY_SLEEP_DELAY):
break

def cancel_sleep_timer(self):
if self.timer is not None:
if self.sleep_enabled and self.timer:
self.timer.cancel()
self.timer = None

Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
aiogram>=3.2.0,<3.3
dependency-injector>=4.41.0,<=4.42
google-generativeai>=0.3.2,<0.4
gunicorn>=21.2.0,<21.3
aiogram~=3.2.0
dependency-injector~=4.41.0
google-generativeai~=0.3.2
gunicorn~=21.2.0
pillow~=10.1.0
pypdfium2~=4.25.0
duckduckgo-search~=4.1.1
Expand Down

0 comments on commit 4b0a66c

Please sign in to comment.