Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
Merge pull request #10 from linuxserver/src
Browse files Browse the repository at this point in the history
build webui from source, update formatting
  • Loading branch information
aptalca committed Sep 19, 2021
2 parents 688259e + fe86560 commit 4a894af
Show file tree
Hide file tree
Showing 13 changed files with 217 additions and 235 deletions.
116 changes: 62 additions & 54 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,75 +1,83 @@
FROM ghcr.io/linuxserver/baseimage-alpine:3.13 as migration-bins
FROM ghcr.io/linuxserver/baseimage-alpine:3.14 as migration-bins

RUN \
echo "**** install buid packages ****" && \
apk add --no-cache \
curl \
git \
go && \
echo "**** build fs-repo-migrations ****" && \
mkdir /bins && \
IPFSMIG_VERSION=$(curl -sX GET "https://api.github.com/repos/ipfs/fs-repo-migrations/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
git clone https://github.com/ipfs/fs-repo-migrations.git && \
cd fs-repo-migrations && \
git checkout ${IPFSMIG_VERSION} && \
for BUILD in fs-repo-migrations fs-repo-9-to-10 fs-repo-10-to-11; do \
cd ${BUILD} && \
go build && \
mv fs-repo-* /bins/ && \
cd .. ; \
done
echo "**** install buid packages ****" && \
apk add --no-cache \
curl \
git \
go && \
echo "**** build fs-repo-migrations ****" && \
mkdir /bins && \
IPFSMIG_VERSION=$(curl -sX GET "https://api.github.com/repos/ipfs/fs-repo-migrations/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
git clone https://github.com/ipfs/fs-repo-migrations.git && \
cd fs-repo-migrations && \
git checkout ${IPFSMIG_VERSION} && \
for BUILD in fs-repo-migrations fs-repo-9-to-10 fs-repo-10-to-11; do \
cd ${BUILD} && \
go build && \
mv fs-repo-* /bins/ && \
cd .. ; \
done

FROM ghcr.io/linuxserver/baseimage-alpine:3.14 as ipfswebui

ARG IPFSWEB_VERSION

RUN \
echo "**** install build packages ****" && \
apk add --no-cache \
alpine-sdk \
git \
nodejs \
npm \
python3-dev && \
echo "**** build frontend ****" && \
if [ -z ${IPFSWEB_VERSION+x} ]; then \
IPFSWEB_VERSION=$(curl -sX GET "https://api.github.com/repos/ipfs/ipfs-webui/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
git clone https://github.com/ipfs/ipfs-webui.git && \
cd ipfs-webui/ && \
git checkout ${IPFSWEB_VERSION} && \
npm install --production && \
npm install typescript && \
NODE_ENV=production \
node node_modules/react-scripts/bin/react-scripts.js build

FROM ghcr.io/linuxserver/baseimage-alpine:3.13
FROM ghcr.io/linuxserver/baseimage-alpine:3.14

# set version label
ARG BUILD_DATE
ARG VERSION
ARG IPFSWEB_VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thelamer"

# environment
ENV IPFS_PATH=/config/ipfs

RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
logrotate \
nginx \
openssl \
php7 \
php7-fpm && \
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \
go-ipfs && \
echo "**** install ipfs web-ui ****" && \
mkdir -p /var/www/html/ && \
if [ -z ${IPFSWEB_VERSION+x} ]; then \
IPFSWEB_VERSION=$(curl -sX GET "https://api.github.com/repos/ipfs/ipfs-webui/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/ipfswebui.tar.gz -L \
"https://github.com/ipfs/ipfs-webui/releases/download/${IPFSWEB_VERSION}/ipfs-webui.tar.gz" && \
tar xf \
/tmp/ipfswebui.tar.gz -C \
/var/www/html/ --strip-components=1 && \
echo "**** configure nginx ****" && \
echo 'fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;' >> \
/etc/nginx/fastcgi_params && \
rm -f /etc/nginx/conf.d/default.conf && \
echo "**** fix logrotate ****" && \
sed -i "s#/var/log/messages {}.*# #g" /etc/logrotate.conf && \
sed -i 's#/usr/sbin/logrotate /etc/logrotate.conf#/usr/sbin/logrotate /etc/logrotate.conf -s /config/log/logrotate.status#g' \
/etc/periodic/daily/logrotate && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
logrotate \
nginx \
openssl && \
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \
go-ipfs && \
mkdir -p /var/www/html && \
echo "**** fix logrotate ****" && \
sed -i "s#/var/log/messages {}.*# #g" /etc/logrotate.conf && \
sed -i 's#/usr/sbin/logrotate /etc/logrotate.conf#/usr/sbin/logrotate /etc/logrotate.conf -s /config/log/logrotate.status#g' \
/etc/periodic/daily/logrotate && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*

# copy files
COPY root/ /
COPY --from=migration-bins /bins /usr/bin
COPY --from=ipfswebui /ipfs-webui/build/ /var/www/html/

# ports and volumes
EXPOSE 80 443 4001 5001 8080
Expand Down
119 changes: 63 additions & 56 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -1,77 +1,84 @@
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.13 as migration-bins
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.14 as migration-bins

RUN \
echo "**** install buid packages ****" && \
apk add --no-cache \
curl \
gcc \
git \
go \
musl-dev && \
echo "**** build fs-repo-migrations ****" && \
mkdir /bins && \
IPFSMIG_VERSION=$(curl -sX GET "https://api.github.com/repos/ipfs/fs-repo-migrations/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
git clone https://github.com/ipfs/fs-repo-migrations.git && \
cd fs-repo-migrations && \
git checkout ${IPFSMIG_VERSION} && \
for BUILD in fs-repo-migrations fs-repo-9-to-10 fs-repo-10-to-11; do \
cd ${BUILD} && \
go build && \
mv fs-repo-* /bins/ && \
cd .. ; \
done
echo "**** install buid packages ****" && \
apk add --no-cache \
alpine-sdk \
curl \
git \
go && \
echo "**** build fs-repo-migrations ****" && \
mkdir /bins && \
IPFSMIG_VERSION=$(curl -sX GET "https://api.github.com/repos/ipfs/fs-repo-migrations/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]') && \
git clone https://github.com/ipfs/fs-repo-migrations.git && \
cd fs-repo-migrations && \
git checkout ${IPFSMIG_VERSION} && \
for BUILD in fs-repo-migrations fs-repo-9-to-10 fs-repo-10-to-11; do \
cd ${BUILD} && \
go build && \
mv fs-repo-* /bins/ && \
cd .. ; \
done

FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.14 as ipfswebui

ARG IPFSWEB_VERSION

RUN \
echo "**** install build packages ****" && \
apk add --no-cache \
alpine-sdk \
git \
nodejs \
npm \
python3-dev && \
echo "**** build frontend ****" && \
if [ -z ${IPFSWEB_VERSION+x} ]; then \
IPFSWEB_VERSION=$(curl -sX GET "https://api.github.com/repos/ipfs/ipfs-webui/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
git clone https://github.com/ipfs/ipfs-webui.git && \
cd ipfs-webui/ && \
git checkout ${IPFSWEB_VERSION} && \
npm install --production && \
npm install typescript && \
NODE_ENV=production \
node node_modules/react-scripts/bin/react-scripts.js build

FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.13
FROM ghcr.io/linuxserver/baseimage-alpine:arm64v8-3.14

# set version label
ARG BUILD_DATE
ARG VERSION
ARG IPFSWEB_VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thelamer"

# environment
ENV IPFS_PATH=/config/ipfs

RUN \
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
logrotate \
nginx \
openssl \
php7 \
php7-fpm && \
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \
go-ipfs && \
echo "**** install ipfs web-ui ****" && \
mkdir -p /var/www/html/ && \
if [ -z ${IPFSWEB_VERSION+x} ]; then \
IPFSWEB_VERSION=$(curl -sX GET "https://api.github.com/repos/ipfs/ipfs-webui/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -o \
/tmp/ipfswebui.tar.gz -L \
"https://github.com/ipfs/ipfs-webui/releases/download/${IPFSWEB_VERSION}/ipfs-webui.tar.gz" && \
tar xf \
/tmp/ipfswebui.tar.gz -C \
/var/www/html/ --strip-components=1 && \
echo "**** configure nginx ****" && \
echo 'fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;' >> \
/etc/nginx/fastcgi_params && \
rm -f /etc/nginx/conf.d/default.conf && \
echo "**** fix logrotate ****" && \
sed -i "s#/var/log/messages {}.*# #g" /etc/logrotate.conf && \
sed -i 's#/usr/sbin/logrotate /etc/logrotate.conf#/usr/sbin/logrotate /etc/logrotate.conf -s /config/log/logrotate.status#g' \
/etc/periodic/daily/logrotate && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*
echo "**** install runtime packages ****" && \
apk add --no-cache \
curl \
logrotate \
nginx \
openssl && \
apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \
go-ipfs && \
mkdir -p /var/www/html && \
echo "**** fix logrotate ****" && \
sed -i "s#/var/log/messages {}.*# #g" /etc/logrotate.conf && \
sed -i 's#/usr/sbin/logrotate /etc/logrotate.conf#/usr/sbin/logrotate /etc/logrotate.conf -s /config/log/logrotate.status#g' \
/etc/periodic/daily/logrotate && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/*

# copy files
COPY root/ /
COPY --from=migration-bins /bins /usr/bin
COPY --from=ipfswebui /ipfs-webui/build/ /var/www/html/

# ports and volumes
EXPOSE 80 443 4001 5001 8080
Expand Down
Loading

0 comments on commit 4a894af

Please sign in to comment.