2018-11-04 02:07:00 +00:00
|
|
|
# ====================
|
|
|
|
# --- Build Assets ---
|
|
|
|
# ====================
|
2023-08-10 21:15:02 +00:00
|
|
|
FROM node:18-alpine AS assets
|
2018-11-04 02:07:00 +00:00
|
|
|
|
2022-04-29 22:57:31 +00:00
|
|
|
RUN apk add yarn g++ make cmake python3 --no-cache
|
2018-11-04 02:07:00 +00:00
|
|
|
|
2019-01-18 20:58:39 +00:00
|
|
|
WORKDIR /wiki
|
2018-11-04 02:07:00 +00:00
|
|
|
|
2018-11-04 02:15:49 +00:00
|
|
|
COPY ./client ./client
|
2018-11-04 02:22:44 +00:00
|
|
|
COPY ./dev ./dev
|
|
|
|
COPY ./package.json ./package.json
|
|
|
|
COPY ./.babelrc ./.babelrc
|
|
|
|
COPY ./.eslintignore ./.eslintignore
|
|
|
|
COPY ./.eslintrc.yml ./.eslintrc.yml
|
2018-11-04 02:07:00 +00:00
|
|
|
|
2019-02-02 19:05:24 +00:00
|
|
|
RUN yarn cache clean
|
|
|
|
RUN yarn --frozen-lockfile --non-interactive
|
2018-11-04 02:07:00 +00:00
|
|
|
RUN yarn build
|
2019-01-18 20:58:39 +00:00
|
|
|
RUN rm -rf /wiki/node_modules
|
2019-02-02 19:05:24 +00:00
|
|
|
RUN yarn --production --frozen-lockfile --non-interactive
|
2023-08-10 22:56:38 +00:00
|
|
|
RUN yarn patch-package
|
2018-11-04 02:07:00 +00:00
|
|
|
|
|
|
|
# ===============
|
|
|
|
# --- Release ---
|
|
|
|
# ===============
|
2023-08-10 21:15:02 +00:00
|
|
|
FROM node:18-alpine
|
2017-10-15 03:56:51 +00:00
|
|
|
LABEL maintainer="requarks.io"
|
|
|
|
|
2020-08-30 20:37:08 +00:00
|
|
|
RUN apk add bash curl git openssh gnupg sqlite --no-cache && \
|
2019-01-18 20:58:39 +00:00
|
|
|
mkdir -p /wiki && \
|
2019-03-30 00:45:31 +00:00
|
|
|
mkdir -p /logs && \
|
2020-01-12 03:33:19 +00:00
|
|
|
mkdir -p /wiki/data/content && \
|
2019-03-30 00:45:31 +00:00
|
|
|
chown -R node:node /wiki /logs
|
2017-10-15 03:56:51 +00:00
|
|
|
|
2019-01-18 20:58:39 +00:00
|
|
|
WORKDIR /wiki
|
2017-10-15 03:56:51 +00:00
|
|
|
|
2019-03-30 00:45:31 +00:00
|
|
|
COPY --chown=node:node --from=assets /wiki/assets ./assets
|
|
|
|
COPY --chown=node:node --from=assets /wiki/node_modules ./node_modules
|
|
|
|
COPY --chown=node:node ./server ./server
|
|
|
|
COPY --chown=node:node --from=assets /wiki/server/views ./server/views
|
|
|
|
COPY --chown=node:node ./dev/build/config.yml ./config.yml
|
|
|
|
COPY --chown=node:node ./package.json ./package.json
|
|
|
|
COPY --chown=node:node ./LICENSE ./LICENSE
|
|
|
|
|
|
|
|
USER node
|
2017-10-15 03:56:51 +00:00
|
|
|
|
2020-01-12 03:33:19 +00:00
|
|
|
VOLUME ["/wiki/data/content"]
|
|
|
|
|
2017-10-15 03:56:51 +00:00
|
|
|
EXPOSE 3000
|
2020-01-12 03:33:19 +00:00
|
|
|
EXPOSE 3443
|
2017-10-15 03:56:51 +00:00
|
|
|
|
2020-01-12 03:33:19 +00:00
|
|
|
# HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 CMD curl -f http://localhost:3000/healthz
|
2019-06-02 01:38:21 +00:00
|
|
|
|
2019-01-18 20:58:39 +00:00
|
|
|
CMD ["node", "server"]
|