diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..2d83f58 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +license.txt +Dockerfile +readme.md +scraper.ex.json + diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..d461032 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,32 @@ +name: Docker Image CI + +on: + push: + +jobs: + + build: + + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + + steps: + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag neofuuka + + - name: Log in to registry + run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin + + - name: Push image + run: | + IMAGE_ID=ghcr.io/${{ github.repository_owner }}/neofuuka + VERSION=force-newest + + echo IMAGE_ID=$IMAGE_ID + echo VERSION=$VERSION + + docker tag neofuuka $IMAGE_ID:$VERSION + docker push $IMAGE_ID:$VERSION diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e2afa2a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM python:3.10.5-bullseye +WORKDIR /neofuuka + +RUN apt update && apt install libmariadb-dev +COPY requirements.txt . +RUN pip install -r requirements.txt + +COPY . . +CMD python scraper.py diff --git a/requirements.txt b/requirements.txt index 1abe921..d191e12 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,4 @@ psutil~=5.8 pymysql~=1.0 pytz~=2021.2 requests~=2.26 +redis~=4.3.4