forked from elifesciences/elife-xpub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (31 loc) · 1.14 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM xpub/xpub:base
WORKDIR ${HOME}
# install Chrome
RUN curl -sL http://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list.d/google.list
RUN apt-get update \
&& apt-get install -y google-chrome-stable \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY package.json yarn.lock ./
COPY client client
COPY server server
# We do a development install because react-styleguidist is a dev dependency and we want to run tests
# Remove cache and offline mirror in the same command, to avoid creating intermediate layers
RUN yarn install --frozen-lockfile \
&& yarn cache clean \
&& rm -rf /npm-packages-offline-cache
COPY app.js .babelrc .eslintignore .eslintrc .prettierrc .stylelintignore .stylelintrc ./
COPY app app
COPY config config
COPY scripts scripts
COPY static static
COPY test test
COPY webpack webpack
ENV NODE_ENV "production"
ARG CI_COMMIT_SHA
ENV CI_COMMIT_SHA ${CI_COMMIT_SHA}
RUN echo "{ \"version\": \"${CI_COMMIT_SHA}\", \"date\":\"$(date)\" }" > app/version.json
RUN [ "npx", "pubsweet", "build"]
EXPOSE 3000
CMD []