Use yarn in Dockerfile and functional test command (#3033)

* Use yarn in Docker
* Also use yarn in bin/start-func-test-server.js
* Install yarn, do not rely on the base image one
This commit is contained in:
William Durand 2017-08-30 19:50:00 +02:00 коммит произвёл GitHub
Родитель f5d909f80f
Коммит 4a77fe0ad6
2 изменённых файлов: 12 добавлений и 4 удалений

Просмотреть файл

@ -7,12 +7,20 @@ WORKDIR /srv/node
RUN buildDeps=' \
git \
yarn \
' && \
# `apt-transport-https` is required to use https deb repositories
apt-get update -y && \
apt-get install -y --no-install-recommends apt-transport-https && \
# configure Yarn repository, see: https://yarnpkg.com/en/docs/install#linux-tab
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg|apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.list.d/yarn.list && \
# the base image installs yarn, let's be sure we use ours
rm -f /usr/local/bin/yarn /usr/local/bin/yarnpkg && \
# install deps
apt-get update -y && \
apt-get install -y --no-install-recommends $buildDeps && \
npm update -g npm@3 && \
npm install && npm cache clean && \
yarn install && \
# cleanup
# apt-get purge -y $buildDeps && \
rm -rf /var/lib/apt/lists/*
@ -31,4 +39,4 @@ RUN ln -s /srv/node/node_modules
ENV SERVER_HOST 0.0.0.0
ENV SERVER_PORT 4000
CMD npm start
CMD yarn start

Просмотреть файл

@ -125,7 +125,7 @@ new Promise((resolve) => {
// This will make sure we can read the logs.
'--log-driver=json-file',
imageId,
'/bin/sh -c "npm run build && npm run start"',
'/bin/sh -c "yarn build && yarn start"',
];
return exec('docker', runArgs);
})