From 98dd5c52dace65be820c6ef417fc32bb01defb9a Mon Sep 17 00:00:00 2001 From: vovastelmashchuk Date: Thu, 7 Dec 2023 10:40:22 +0200 Subject: [PATCH] Fixed docker file and add ci for build docker images --- .github/workflows/build_image.yml | 37 +++++++++++++++++++++++++++++++ Dockerfile | 2 +- app/config_debug.json | 2 +- requirements.txt | 2 +- wsgi.py | 6 ----- 5 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/build_image.yml delete mode 100644 wsgi.py diff --git a/.github/workflows/build_image.yml b/.github/workflows/build_image.yml new file mode 100644 index 0000000..adeada9 --- /dev/null +++ b/.github/workflows/build_image.yml @@ -0,0 +1,37 @@ +name: Build Image Cross Platform + +on: + push: + branches: + - master + - fix_docker + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v2 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKERHUB_USER_NAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v1 + - name: Available platforms + run: echo ${{ steps.buildx.outputs.platforms }} + + - name: Build and push + uses: docker/build-push-action@v2.7.0 + with: + context: ./ + file: ./Dockerfile + platforms: linux/arm64/v8, linux/arm64, linux/amd64 + push: true + tags: | + 0.1.9 diff --git a/Dockerfile b/Dockerfile index 650f0b1..215b53f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,6 @@ COPY requirements.txt /app RUN --mount=type=cache,target=/root/.cache/pip \ pip3 install -r requirements.txt -COPY . /app +COPY ./app /app CMD ["gunicorn", "--bind", "0.0.0.0:5000", "application:app"] \ No newline at end of file diff --git a/app/config_debug.json b/app/config_debug.json index d4a43d5..30ef320 100644 --- a/app/config_debug.json +++ b/app/config_debug.json @@ -18,7 +18,7 @@ "NOTIFIER": { "CURRENT_NOTIFIER": "SLACK", "SLACK_CHANNEL": "#prismo-debugxx", - "SLACK_TOKEN": "xoxb-10631168368-6285659487555-mlu3mtOsfnSI74TNS4JOjBvg" + "SLACK_TOKEN": "xoxb-156594252659-6059712941424-f2Ot4xppyE5wvLs1RtgGPj0N" } } } \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 6a098fa..b4d5d4a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -10,5 +10,5 @@ pylint pycodestyle gunicorn==20.0.4 argon2-cffi -pyee +pyee~=11.1.0 slack-bolt diff --git a/wsgi.py b/wsgi.py deleted file mode 100644 index 37e1e82..0000000 --- a/wsgi.py +++ /dev/null @@ -1,6 +0,0 @@ -import os - -from application import app - -if __name__ == "__main__": - app.run(host='0.0.0.0', port=os.environ.get("FLASK_SERVER_PORT"), debug=True)