-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
85 lines (79 loc) · 2.4 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
85
# syntax=docker/dockerfile:1
FROM ghcr.io/linuxserver/baseimage-alpine:3.20
ARG BUILD_DATE
ARG VERSION
ARG MANYFOLD_VERSION
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="thespad"
ENV RAILS_ENV="production" \
NODE_ENV="production" \
RACK_ENV="production" \
DOCKER_TAG=lscr.io/linuxserver/manyfold:${VERSION} \
PORT=3214 \
RAILS_SERVE_STATIC_FILES=true \
APP_VERSION=${MANYFOLD_VERSION}
RUN \
apk add --no-cache \
file \
glfw \
libarchive \
libstdc++ \
mariadb-connector-c \
mesa-gl \
pciutils \
postgresql16-client \
ruby \
ruby-bundler && \
apk add --no-cache --virtual=build-dependencies \
build-base \
git \
grep \
libffi-dev \
mariadb-dev \
nodejs \
npm \
postgresql-dev \
ruby-dev \
yaml-dev && \
echo "**** install manyfold ****" && \
mkdir -p /app/www && \
if [ -z ${MANYFOLD_VERSION+x} ]; then \
MANYFOLD_VERSION=$(curl -sX GET "https://api.github.com/repos/manyfold3d/manyfold/releases/latest" \
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
fi && \
curl -sX GET "https://api.github.com/repos/manyfold3d/manyfold/git/matching-refs/tags/${MANYFOLD_VERSION}" \
| jq -r '.[].object.sha' > /app/www/GIT_SHA && \
curl -s -o \
/tmp/manyfold.tar.gz -L \
"https://github.com/manyfold3d/manyfold/archive/${MANYFOLD_VERSION}.tar.gz" && \
tar xf \
/tmp/manyfold.tar.gz -C \
/app/www/ --strip-components=1 && \
cd /app/www && \
npm install -g corepack && \
corepack enable && \
yarn install && \
gem install foreman && \
RUBY=$(apk list ruby | grep -oP '.*-\K(\d\.\d\.\d)') && \
sed -i "s/\d.\d.\d/${RUBY}/" .ruby-version && \
bundle config set --local deployment 'true' && \
bundle config set --local without 'development test' && \
bundle config force_ruby_platform true && \
bundle install && \
DATABASE_URL="nulldb://user:pass@localhost/db" \
SECRET_KEY_BASE="placeholder" \
bundle exec rake assets:precompile && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
echo "**** cleanup ****" && \
yarn cache clean && \
apk del --purge \
build-dependencies && \
rm -rf \
$HOME/.bundle/cache \
$HOME/.composer \
/app/www/node_modules/ \
/app/www/tmp/cache/ \
/app/www/vendor/bundle/ruby/3.3.0/cache/* \
/tmp/*
COPY root/ /
EXPOSE 3214