Skip to content

Commit

Permalink
Merge pull request #196 from jamescurtin/support-arm
Browse files Browse the repository at this point in the history
Support ARM for local development
  • Loading branch information
iragm authored Aug 31, 2024
2 parents 4672510 + 1acd1f5 commit 884a008
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/scripts/prepare-ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

cp .env.example .env
14 changes: 14 additions & 0 deletions .github/workflows/image-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Docker images build
on:
push:
pull_request:
branches: [master]

jobs:
image-build:
name: Test Images Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./.github/scripts/prepare-ci.sh
- run: docker compose build
21 changes: 16 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
###########

# pull official base image
FROM python:3.11.4-slim-buster AS builder
FROM python:3.11.9 AS builder

# set work directory
WORKDIR /usr/src/app
Expand All @@ -16,8 +16,16 @@ ENV PYTHONUNBUFFERED=1
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
# mysqlclient dependencies
pkg-config \
default-libmysqlclient-dev && \
default-libmysqlclient-dev \
# TODO: Remove libheif dependencies. They are only necssary because
# pyheif doesn't yet release an ARM compatible wheel. Once a compatible
# wheel is published on pypi, these dependencies should be removed from
# both the builder and final images.
libheif-dev \
# end libheif dependencies
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand All @@ -40,7 +48,7 @@ RUN pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/app/wheels -r requir
#########

# pull official base image
FROM python:3.11.4-slim-buster
FROM python:3.11.9-slim

# create directory for the app user
RUN mkdir -p /home/app
Expand All @@ -64,12 +72,15 @@ WORKDIR $APP_HOME
# install dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
netcat \
netcat-traditional \
build-essential \
pkg-config \
default-libmysqlclient-dev \
cron \
nano && \
nano \
# libheif dependencies
libheif-dev \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

Expand Down

0 comments on commit 884a008

Please sign in to comment.