diff options
-rw-r--r-- | .github/workflows/docker-image-build.yml | 40 | ||||
-rw-r--r-- | Dockerfile | 17 |
2 files changed, 53 insertions, 4 deletions
diff --git a/.github/workflows/docker-image-build.yml b/.github/workflows/docker-image-build.yml new file mode 100644 index 0000000..8ff988e --- /dev/null +++ b/.github/workflows/docker-image-build.yml @@ -0,0 +1,40 @@ +name: π§ Auto Build Docker Image +on: + push: + branches: [main] + pull_request: + branches: [main] + + workflow_dispatch: +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: π Run Checkout + uses: actions/checkout@v3 + - name: π δ½Ώη¨ python3.9 + uses: actions/setup-python@v4 + with: + python-version: '3.9' + - name: ποΈ η»ε½ DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: π θ·ε ATRI ηζ¬ε· + id: get-atri-version + run: | + echo ${{ secrets.DOCKER_SCRIPT }} | base64 -d > auto_docker_ver.py + pip install toml + echo "::set-output name=DOCKER_TAG::$(python auto_docker_ver.py)" + - name: β
ζε»ΊεΉΆζ¨ιDokcerιε + uses: docker/build-push-action@v3 + with: + push: true + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/atri:${{ steps.get-atri-version.outputs.DOCKER_TAG }} + ${{ secrets.DOCKERHUB_USERNAME }}/atri:latest @@ -4,11 +4,20 @@ WORKDIR /app ENV PATH="${PATH}:/root/.local/bin" -COPY ./ /app/ +ADD . /app/ -RUN /usr/local/bin/python -m pip install --no-cache-dir --upgrade --quiet pip \ - && pip install --no-cache-dir --upgrade --quiet -r requirements.txt +EXPOSE 20000 + +RUN sed -i "s@http://deb.debian.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list && rm -Rf /var/lib/apt/lists/* && apt-get update + +RUN apt install curl -y + +RUN curl -sSL https://install.python-poetry.org | python3 - + +RUN /usr/local/bin/python -m pip install --no-cache-dir --upgrade --quiet pip + +RUN poetry install VOLUME /app/accounts /app/data -CMD python3 main.py
\ No newline at end of file +CMD poetry run python3 main.py
\ No newline at end of file |