Skip to content

Commit

Permalink
github action: add apt-get package and separate amd64 and arm64 builds
Browse files Browse the repository at this point in the history
Looks like only arm64 is failing
  • Loading branch information
dale-wahl committed Feb 5, 2025
1 parent a43c9aa commit 8444673
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 9 deletions.
50 changes: 45 additions & 5 deletions .github/workflows/docker_latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,53 @@ on:
push:
branches: [ "master" ]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
push_to_registry_amd64:
name: Push Docker image to Docker Hub (amd64)
runs-on: ubuntu-latest
steps:
- name: Check out the repo
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_DALE_LOGIN }}
password: ${{ secrets.DOCKER_DALE_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: digitalmethodsinitiative/4cat

- name: Build and push Docker image (amd64)
uses: docker/[email protected]
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64
push: true
tags: digitalmethodsinitiative/4cat:latest
retry:
max-attempts: 2
delay-seconds: 30

push_to_registry_arm64:
name: Push Docker image to Docker Hub (arm64)
runs-on: ubuntu-latest
steps:
- name: Check out the repo
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

Expand All @@ -33,11 +70,14 @@ jobs:
with:
images: digitalmethodsinitiative/4cat

- name: Build and push Docker image
- name: Build and push Docker image (arm64)
uses: docker/[email protected]
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64,linux/arm64
platforms: linux/arm64
push: true
tags: digitalmethodsinitiative/4cat:latest
retry:
max-attempts: 2
delay-seconds: 30
12 changes: 8 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ FROM python:3.11-slim

RUN apt-get update && apt install -y \
# General requirements:
build-essential \
libpq-dev \
python3-dev \
python3-pip \
Expand All @@ -14,16 +15,18 @@ RUN apt-get update && apt install -y \
# Called by 4CAT:
git \
# Needed for video processing only (and only technically on backend)
ffmpeg
ffmpeg \
# Clean up after apt-get:
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /usr/src/app

# Ensure that Python outputs everything that's printed inside to containers
ENV PYTHONUNBUFFERED=1

# Install dependencies
RUN pip3 install --upgrade pip
# Set up environment for Python setup.py
COPY ./requirements.txt /usr/src/app/requirements.txt
COPY ./extensions /usr/src/app/extensions
COPY ./setup.py /usr/src/app/setup.py
Expand All @@ -32,7 +35,8 @@ COPY ./README.md /usr/src/app/README.md
RUN mkdir /usr/src/app/backend
RUN mkdir /usr/src/app/webtool
RUN mkdir /usr/src/app/datasources
RUN pip3 install -r requirements.txt
# Install python dependencies
RUN pip3 install --upgrade pip && pip3 install -r requirements.txt

# Install frontend Docker requirements
RUN pip3 install gunicorn
Expand Down

0 comments on commit 8444673

Please sign in to comment.