wikijs-fork/dev/build/Dockerfile

52 lines
1.3 KiB
Docker
Raw Normal View History

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