wikijs-fork/dev/build/Dockerfile

55 lines
1.4 KiB
Docker
Raw Normal View History

2018-11-04 02:07:00 +00:00
# ====================
# --- Build Assets ---
# ====================
FROM node:14-alpine AS assets
2018-11-04 02:07:00 +00:00
RUN apk add yarn g++ make python --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
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
2018-11-04 02:07:00 +00:00
# ===============
# --- Release ---
# ===============
FROM node:14-alpine
2017-10-15 03:56:51 +00:00
LABEL maintainer="requarks.io"
RUN apk add bash curl git openssh gnupg sqlite pandoc --no-cache && \
2019-01-18 20:58:39 +00:00
mkdir -p /wiki && \
mkdir -p /logs && \
2020-01-12 03:33:19 +00:00
mkdir -p /wiki/data/content && \
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
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"]