Skip to content

Commit

Permalink
update to match linuxserver's version
Browse files Browse the repository at this point in the history
  • Loading branch information
OttPeterR committed May 7, 2023
1 parent 9954d8f commit c113f7f
Showing 1 changed file with 27 additions and 48 deletions.
75 changes: 27 additions & 48 deletions babybuddy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/base:13.2.2
FROM ghcr.io/linuxserver/baseimage-alpine-nginx:3.17

# hadolint ignore=DL3006
FROM ${BUILD_FROM}
ARG BABYBUDDY_VERSION=1.16.0

VOLUME ["/run"]
# set version label
ARG BUILD_DATE
ARG VERSION
ARG BABYBUDDY_VERSION=1.16.0
LABEL build_version="Build-date:- ${BUILD_DATE}"

# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
ENV S6_STAGE2_HOOK="/init-hook"

# hadolint ignore=DL3003
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
build-base \
curl \
jpeg-dev \
libffi-dev \
libxml2-dev \
libxslt-dev \
postgresql-dev \
python3-dev \
zlib-dev

# hadolint ignore=DL3003
RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache \
Expand All @@ -31,58 +31,37 @@ RUN \
libxml2 \
libxslt \
py3-mysqlclient \
py3-pip \
python3 \
nginx

python3
RUN \
echo "**** downloading babybuddy ****" && \
echo "**** install babybuddy ****" && \
if [ -z ${BABYBUDDY_VERSION+x} ]; then \
BABYBUDDY_VERSION=$(curl -sX GET "https://api.github.com/repos/babybuddy/babybuddy/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/babybuddy.tar.gz -L \
"https://github.com/babybuddy/babybuddy/archive/refs/tags/v1.16.0.tar.gz" && \
mkdir -p /app/babybuddy && \
"https://github.com/babybuddy/babybuddy/archive/refs/tags/${BABYBUDDY_VERSION}.tar.gz" && \
mkdir -p /app/www/public && \
tar xf \
/tmp/babybuddy.tar.gz -C \
/app/babybuddy --strip-components=1

RUN \
echo "**** installing babybuddy ****" && \
cd /app/babybuddy && \
/app/www/public --strip-components=1 && \
cd /app/www/public && \
python3 -m ensurepip && \
pip3 install -U --no-cache-dir \
pip && \
pip install -U --ignore-installed -r requirements.txt

pip \
wheel && \
pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/alpine-3.17/ -r requirements.txt
RUN \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/etc/nginx \
/opt/build \
/opt/index.html \
/opt/package.sh \
/opt/src \
/opt/static \
/opt/stylesheets \
/opt/.[!.]* \
/opt/*.md \
/opt/nodemon.json \
/opt/kustomization.yaml \
/opt/kubernetes \
/opt/docker \
/opt/docs \
/root/.cache \
/root/.config \
/root/.npmrc \
/root/.node-gyp \
/root/.npm \
/tmp/.[!.]* \
/tmp/* \
/usr/lib/node_modules \
/usr/local/share/.cache

COPY rootfs /
$HOME/.cache \
$HOME/.cargo

# copy local files
COPY root/ /
# Build arguments
ARG BUILD_VERSION

Expand Down

0 comments on commit c113f7f

Please sign in to comment.