Dockerfile 1.71 KB
Newer Older
1
FROM xpub/xpub:base
Sam Galson's avatar
Sam Galson committed
2

3
WORKDIR ${HOME}
4 5 6 7

# 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
Nikos Marinos's avatar
Nikos Marinos committed
8
RUN apt-get update && apt-get install -y google-chrome-stable cron vim
9 10

# install Firefox - apparently no debian package for firefox 57
Jure's avatar
Jure committed
11
RUN apt-get install -y libdbus-glib-1-2
12 13 14
RUN cd /opt && wget http://ftp.mozilla.org/pub/firefox/releases/57.0.4/linux-x86_64/en-GB/firefox-57.0.4.tar.bz2 && \
    tar xjf firefox-*.tar.bz2 && \
    ln -s /opt/firefox/firefox /usr/local/bin/
MoSelim's avatar
MoSelim committed
15 16
# install zip command
RUN apt-get install zip unzip
17
# RUN apt-get install -y default-jdk libstdc++6
18
RUN apt-get install -y default-jdk
Nikos Marinos's avatar
Nikos Marinos committed
19 20 21
#COPY node-libxml node-libxml
#WORKDIR node-libxml
#RUN ["npm", "install"]
22 23
WORKDIR ${HOME}

24
COPY package.json yarn.lock ./
25 26
ENV NODE_ENV "development"

Nikos Marinos's avatar
Nikos Marinos committed
27 28
RUN npm install -g node-pre-gyp

29 30 31
# Install pm2
RUN [ "yarn", "global", "add", "pm2" ]

32
# We do a development install because react-styleguidist is a dev dependency and we want to run tests
Nikos Marinos's avatar
Nikos Marinos committed
33
RUN [ "yarn", "install" ]
34 35 36 37 38

# Remove cache and offline mirror
RUN [ "yarn", "cache", "clean"]
RUN [ "rm", "-rf", "/npm-packages-offline-cache"]

Nikos Marinos's avatar
Nikos Marinos committed
39 40 41 42 43 44 45 46
# Add crontab file in the cron directory
ADD crontab /etc/cron.d/crontab
# Give execution rights on the cron job
RUN chmod 0644 /etc/cron.d/crontab

# Apply cron job
RUN crontab /etc/cron.d/crontab

47
COPY app.js .babelrc .eslintignore .eslintrc .prettierrc .stylelintignore .stylelintrc ./
Sam Galson's avatar
Sam Galson committed
48

49
COPY app app
50 51 52
COPY config config
COPY scripts scripts
COPY static static
53
COPY test test
54
COPY webpack webpack
55
COPY server server
Nikos Marinos's avatar
Nikos Marinos committed
56
COPY ./*.sh ./
57
COPY ./*.js ./
Sam Galson's avatar
Sam Galson committed
58

59
ENV NODE_ENV ${NODE_ENV}
Sam Galson's avatar
Sam Galson committed
60

61
RUN [ "npx", "pubsweet", "build"]
Sam Galson's avatar
Sam Galson committed
62 63

CMD []