2022-01-10 07:12:42 +00:00
|
|
|
FROM alpine:3.15 as builder
|
2019-11-02 10:32:49 +00:00
|
|
|
|
|
|
|
RUN apk add --no-cache \
|
|
|
|
git \
|
2020-04-05 11:08:18 +00:00
|
|
|
npm \
|
2020-01-06 15:02:57 +00:00
|
|
|
bash \
|
2020-09-18 14:38:51 +00:00
|
|
|
python3 \
|
|
|
|
make
|
2019-11-02 10:32:49 +00:00
|
|
|
|
2020-04-07 15:59:54 +00:00
|
|
|
#ENV NODE_ENV=production
|
2020-04-05 11:17:02 +00:00
|
|
|
|
2019-11-02 10:39:51 +00:00
|
|
|
# to get around errors from differing stack sizes in musl
|
|
|
|
# https://wiki.musl-libc.org/functional-differences-from-glibc.html#Thread_stack_size
|
2020-04-05 11:06:49 +00:00
|
|
|
RUN npm config set unsafe-perm true
|
2020-09-18 14:38:51 +00:00
|
|
|
RUN npm install -g \
|
|
|
|
webpack \
|
|
|
|
webpack-cli \
|
|
|
|
node-gyp
|
2019-11-02 10:32:49 +00:00
|
|
|
|
2022-02-15 17:01:47 +00:00
|
|
|
ENV WIKIJS_VERSION=v2.5.275
|
2019-11-02 11:41:36 +00:00
|
|
|
|
2020-01-07 14:50:36 +00:00
|
|
|
RUN git clone https://github.com/Requarks/wiki.git -b $WIKIJS_VERSION /build
|
2019-11-02 10:32:49 +00:00
|
|
|
|
|
|
|
WORKDIR /build
|
2021-06-20 11:17:37 +00:00
|
|
|
RUN npm install --legacy-peer-deps
|
2020-09-18 14:38:51 +00:00
|
|
|
# don't know why this is needed here too, but what the hell
|
2020-04-07 15:59:54 +00:00
|
|
|
RUN npm install --save-dev webpack webpack-cli
|
|
|
|
RUN npx webpack --profile --config dev/webpack/webpack.prod.js
|
2019-11-02 10:32:49 +00:00
|
|
|
|
|
|
|
FROM thallian/confd-env:latest
|
|
|
|
|
2020-04-05 11:16:45 +00:00
|
|
|
ENV NODE_ENV=production
|
2020-04-05 11:06:49 +00:00
|
|
|
|
2019-11-02 10:32:49 +00:00
|
|
|
RUN addgroup -g 2222 wikijs
|
|
|
|
RUN adduser -h /home/wikijs -S -D -u 2222 -G wikijs wikijs
|
|
|
|
|
|
|
|
COPY --from=builder --chown=wikijs:wikijs /build/assets /home/wikijs/assets
|
|
|
|
COPY --from=builder --chown=wikijs:wikijs /build/node_modules /home/wikijs/node_modules
|
|
|
|
COPY --from=builder --chown=wikijs:wikijs /build/server /home/wikijs/server
|
|
|
|
COPY --from=builder --chown=wikijs:wikijs /build/LICENSE /home/wikijs/LICENSE
|
|
|
|
COPY --from=builder --chown=wikijs:wikijs /build/config.sample.yml /home/wikijs/config.sample.yml
|
|
|
|
COPY --from=builder --chown=wikijs:wikijs /build/package.json /home/wikijs/package.json
|
|
|
|
|
2019-11-02 11:00:06 +00:00
|
|
|
RUN apk add --no-cache \
|
2020-04-08 10:41:47 +00:00
|
|
|
nodejs \
|
2020-04-08 10:48:40 +00:00
|
|
|
git \
|
|
|
|
openssh-client
|
2019-11-02 10:32:49 +00:00
|
|
|
|
|
|
|
ADD /rootfs /
|
|
|
|
|
|
|
|
VOLUME [ "/home/wikijs/data" ]
|
|
|
|
EXPOSE 3000
|