This repository has been archived by the owner on Feb 4, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile
84 lines (74 loc) · 2.41 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
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
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 v2.13.0 && \
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.14
# set version label
ARG BUILD_DATE
ARG 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 && \
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
VOLUME ["/config"]