2018-11-04 02:07:00 +00:00
|
|
|
# ====================
|
|
|
|
# --- Build Assets ---
|
|
|
|
# ====================
|
|
|
|
FROM node:10-alpine AS assets
|
|
|
|
|
|
|
|
RUN apk update && \
|
|
|
|
apk add yarn g++ make python --no-cache && \
|
|
|
|
rm -rf /var/cache/apk/* && \
|
|
|
|
mkdir -p /var/wiki
|
|
|
|
|
|
|
|
WORKDIR /var/wiki
|
|
|
|
|
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
|
|
|
|
2018-11-04 18:19:49 +00:00
|
|
|
RUN yarn --cache-folder /codefresh/volume/yarn
|
2018-11-04 02:07:00 +00:00
|
|
|
RUN yarn build
|
|
|
|
RUN rm -rf /var/wiki/node_modules
|
|
|
|
RUN yarn --production
|
|
|
|
|
|
|
|
# ===============
|
|
|
|
# --- Release ---
|
|
|
|
# ===============
|
2018-09-08 19:49:36 +00:00
|
|
|
FROM node:10-alpine
|
2017-10-15 03:56:51 +00:00
|
|
|
LABEL maintainer="requarks.io"
|
|
|
|
|
|
|
|
RUN apk update && \
|
|
|
|
apk add bash curl git openssh supervisor --no-cache && \
|
2018-11-04 02:07:00 +00:00
|
|
|
rm -rf /var/cache/apk/* && \
|
2018-11-04 18:14:09 +00:00
|
|
|
mkdir -p /var/wiki && \
|
|
|
|
mkdir -p /logs
|
2017-10-15 03:56:51 +00:00
|
|
|
|
|
|
|
WORKDIR /var/wiki
|
|
|
|
|
2018-11-04 02:07:00 +00:00
|
|
|
COPY ./dev/build/supervisord.conf /etc/supervisord.conf
|
|
|
|
COPY --from=assets /var/wiki/assets ./assets
|
|
|
|
COPY --from=assets /var/wiki/node_modules ./node_modules
|
2018-11-04 02:15:49 +00:00
|
|
|
COPY ./server ./server
|
2018-11-04 18:31:09 +00:00
|
|
|
COPY --from=assets /var/wiki/server/views ./server/views
|
2018-11-04 17:55:21 +00:00
|
|
|
COPY ./dev/build/config.yml ./config.yml
|
2018-11-04 02:15:49 +00:00
|
|
|
COPY ./package.json ./package.json
|
|
|
|
COPY ./LICENSE ./LICENSE
|
2017-10-15 03:56:51 +00:00
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
|
|
CMD ["supervisord", "--nodaemon", "-c", "/etc/supervisord.conf"]
|