Skip to content

Commit

Permalink
Update installed packages
Browse files Browse the repository at this point in the history
* remove git, which was not used
* use the base image for building, which saves us installing one or two things
* add a bunch of stuff so that the images build for arm/v7
  • Loading branch information
rolandgeider committed Jul 11, 2023
1 parent 0a10793 commit 02697ac
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Expand Up @@ -59,5 +59,5 @@ jobs:
context: .
push: true
file: extras/docker/development/Dockerfile
platforms: linux/amd64,linux/arm64
platforms: linux/amd64,linux/arm64,linux/arm/v7
tags: wger/server:latest,wger/server:2.2-dev,wger/devel:latest,wger/devel:2.2-dev
3 changes: 0 additions & 3 deletions extras/docker/base/Dockerfile
Expand Up @@ -16,15 +16,12 @@ LABEL maintainer="Roland Geider <roland@geider.net>"
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
git \
locales \
nodejs \
npm \
python3-venv \
python3-pip \
sqlite3 \
wget \
libpq5 \
&& rm -rf /var/lib/apt/lists/* \
&& npm install -g yarn sass\
&& locale-gen en_US.UTF-8
Expand Down
20 changes: 13 additions & 7 deletions extras/docker/demo/Dockerfile
Expand Up @@ -17,28 +17,33 @@
##########
# Builder
##########
FROM ubuntu:22.04 as builder
FROM wger/base:latest as builder
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install --no-install-recommends -y \
build-essential \
python3-dev \
python3-pip \
python3-wheel \
pkg-config \
libcairo2-dev \
git

# Set up the application
libjpeg8-dev \
libwebp-dev \
libpq-dev \
rustc \
cargo \
&& pip install --upgrade pip

# Build the necessary python wheels
# Note that the --mount is a workaround for https://github.com/rust-lang/cargo/issues/8719
COPY requirements* ./
RUN pip3 wheel --no-cache-dir --wheel-dir /usr/src/app/wheels -r requirements_dev.txt
RUN --mount=type=tmpfs,target=/root/.cargo pip3 wheel --no-cache-dir --wheel-dir /wheels -r requirements_docker.txt


########
# Final
########
FROM wger/base:2.2-dev
FROM wger/base:latest
LABEL maintainer="Roland Geider <roland@geider.net>"

ARG DOCKER_DIR=./extras/docker/demo
Expand All @@ -50,6 +55,7 @@ RUN apt-get update \
&& apt-get install --no-install-recommends -y \
apache2 \
cron \
python3-venv \
libapache2-mod-wsgi-py3 \
python3-wheel \
&& rm -rf /var/lib/apt/lists/*
Expand Down
16 changes: 10 additions & 6 deletions extras/docker/development/Dockerfile
Expand Up @@ -12,30 +12,34 @@
##########
# Builder
##########
FROM ubuntu:22.04 as builder
FROM wger/base:latest as builder
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install --no-install-recommends -y \
build-essential \
python3-dev \
python3-pip \
python3-wheel \
pkg-config \
libcairo2-dev \
git \
libpq-dev
libjpeg8-dev \
libwebp-dev \
libpq-dev \
rustc \
cargo \
&& pip install --upgrade pip

# Build the necessary python wheels
# Note that the --mount is a workaround for https://github.com/rust-lang/cargo/issues/8719
COPY requirements* ./
RUN pip3 wheel --no-cache-dir --wheel-dir /wheels -r requirements_docker.txt
RUN --mount=type=tmpfs,target=/root/.cargo pip3 wheel --no-cache-dir --wheel-dir /wheels -r requirements_docker.txt



########
# Final
########
FROM wger/base:2.2-dev
FROM wger/base:latest
LABEL maintainer="Roland Geider <roland@geider.net>"
ARG DOCKER_DIR=./extras/docker/development
ENV PATH="/home/wger/.local/bin:$PATH"
Expand Down

0 comments on commit 02697ac

Please sign in to comment.