wikijs/Containerfile

58 lines
1.6 KiB
Text
Raw Normal View History

2023-12-15 10:25:32 +01:00
FROM docker.io/alpine:3.19 as builder
2019-11-02 11:32:49 +01:00
RUN apk add --no-cache \
2022-12-19 11:04:00 +01:00
git \
npm \
bash \
python3 \
make \
2023-12-15 10:25:32 +01:00
sed \
g++ \
musl-dev
2019-11-02 11:32:49 +01:00
2020-04-07 17:59:54 +02:00
#ENV NODE_ENV=production
2020-04-05 13:17:02 +02:00
# to get around errors from differing stack sizes in musl
# https://wiki.musl-libc.org/functional-differences-from-glibc.html#Thread_stack_size
2022-12-19 11:04:00 +01:00
#RUN npm config set unsafe-perm true
ENV NODE_OPTIONS=--openssl-legacy-provider
2020-09-18 16:38:51 +02:00
RUN npm install -g \
2023-07-31 11:26:58 +02:00
webpack \
webpack-cli \
node-gyp
2019-11-02 11:32:49 +01:00
2024-03-28 15:02:27 +01:00
ENV WIKIJS_VERSION=v2.5.301
2019-11-02 12:41:36 +01:00
RUN git clone https://github.com/Requarks/wiki.git -b $WIKIJS_VERSION /build
2019-11-02 11:32:49 +01:00
WORKDIR /build
2021-06-20 13:17:37 +02:00
RUN npm install --legacy-peer-deps
2020-09-18 16:38:51 +02:00
# don't know why this is needed here too, but what the hell
2022-07-12 20:39:51 +02:00
RUN npm install --legacy-peer-deps --save-dev webpack webpack-cli
2020-04-07 17:59:54 +02:00
RUN npx webpack --profile --config dev/webpack/webpack.prod.js
2022-07-02 19:11:43 +02:00
RUN sed -i '0,/.*"dev".*/s//"dev": false,/' package.json
2019-11-02 11:32:49 +01:00
2023-12-15 10:25:32 +01:00
FROM docker.io/thallian/confd-env:3.19-3.1.6.2
2019-11-02 11:32:49 +01:00
2020-04-05 13:16:45 +02:00
ENV NODE_ENV=production
2020-04-05 13:06:49 +02:00
2019-11-02 11:32:49 +01: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
RUN apk add --no-cache \
2022-12-19 11:04:00 +01:00
nodejs \
git \
openssh-client
2019-11-02 11:32:49 +01:00
ADD /rootfs /
VOLUME [ "/home/wikijs/data" ]
EXPOSE 3000