Skip to content

Commit

Permalink
Merge pull request #9 from Uni0305/master
Browse files Browse the repository at this point in the history
Fixed ModuleNotFoundError
  • Loading branch information
Th0rgal authored Jan 24, 2024
2 parents 46a1aff + 39218f0 commit 3156d21
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 11 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build and Push Docker Image

on:
push:
branches:
- master

env:
DOCKER_REGISTRY: ghcr.io
DOCKER_USERNAME: ${{ github.actor }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
- name: Set up Build Environment
run: echo "DOCKER_IMAGE=${GITHUB_REPO,,}" >> $GITHUB_ENV
env:
GITHUB_REPO: ${{ github.repository }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
labels: |
org.opencontainers.image.source = "${{ github.server_url }}/${{ github.repository }}"
tags: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}:latest
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,7 @@ dmypy.json

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.history

# IDEA
.idea/
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
FROM python:3.8
FROM python:3.8 AS builder
WORKDIR /polymath
COPY . .
RUN pip install -r requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
RUN sh build.sh

FROM python:3.8-alpine AS runner
WORKDIR /polymath
COPY --from=builder /polymath .
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 8080
VOLUME /polymath/data
ENV PYTHONUNBUFFERED "1"
CMD ["python", "-u", "run"]
CMD ["python", "-u", "run"]
4 changes: 2 additions & 2 deletions polymath/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import toml
import shutil
import utils
from polymath import utils
import toml


class Config:
Expand Down
8 changes: 4 additions & 4 deletions polymath/core.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from config import TomlConfig
from packs import PacksManager
from polymath.config import TomlConfig
from polymath.packs import PacksManager
from aiohttp import web
import asyncio
import server
import cleaner
from polymath import server
from polymath import cleaner


async def main():
Expand Down
2 changes: 1 addition & 1 deletion polymath/packs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import utils
from polymath import utils
import hashlib
import time
import os
Expand Down

0 comments on commit 3156d21

Please sign in to comment.