From 41545a202f3148a40ae74bb9f09e4964561ba200 Mon Sep 17 00:00:00 2001 From: Daniele Guido Date: Tue, 11 Feb 2025 11:47:58 +0100 Subject: [PATCH 1/3] Create docker-build-publish-pr.yml --- .github/workflows/docker-build-publish-pr.yml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/docker-build-publish-pr.yml diff --git a/.github/workflows/docker-build-publish-pr.yml b/.github/workflows/docker-build-publish-pr.yml new file mode 100644 index 0000000..62b990e --- /dev/null +++ b/.github/workflows/docker-build-publish-pr.yml @@ -0,0 +1,29 @@ +name: Build and Publish Docker Image for Preview + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + 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: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: c2dhunilu/journal-of-digital-history-backend:preview From 3ec19a30c510b2f420d2757774c6e8fd7d41e5a4 Mon Sep 17 00:00:00 2001 From: Daniele Guido Date: Tue, 11 Feb 2025 12:18:02 +0100 Subject: [PATCH 2/3] update psycopg and downgrade python :) --- Dockerfile | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e74a8c5..4cf2494 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.12-alpine +FROM python:3.8-alpine WORKDIR /journal-of-digital-history-backend ARG GIT_TAG diff --git a/requirements.txt b/requirements.txt index 8e8357b..1b3ef15 100644 --- a/requirements.txt +++ b/requirements.txt @@ -37,7 +37,7 @@ notebook==6.2.0 packaging==21.3 Pillow==10.1.0 prompt-toolkit==3.0.8 -psycopg2-binary==2.8.6 +psycopg2-binary==2.9.7 pycountry==22.3.5 pyrsistent==0.17.3 pytz==2020.4 From da733c7487519e57a3b2424030895589cf144628 Mon Sep 17 00:00:00 2001 From: Daniele Guido Date: Tue, 11 Feb 2025 12:18:04 +0100 Subject: [PATCH 3/3] Update Makefile --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 293a60c..6cd6d3d 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,10 @@ run-dev: pipenv run ./manage.py runserver 8889 build-docker-image: - docker build \ + docker buildx build \ + --platform=linux/amd64 \ -t c2dhunilu/journal-of-digital-history-backend:${BUILD_TAG} \ + --push \ --build-arg GIT_TAG=$(shell git describe --tags) \ --build-arg GIT_BRANCH=$(shell git rev-parse --abbrev-ref HEAD) \ --build-arg GIT_REVISION=$(shell git rev-parse --short HEAD) .