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:
Родитель
f5d909f80f
Коммит
4a77fe0ad6
14
Dockerfile
14
Dockerfile
|
@ -7,12 +7,20 @@ WORKDIR /srv/node
|
||||||
|
|
||||||
RUN buildDeps=' \
|
RUN buildDeps=' \
|
||||||
git \
|
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
|
# install deps
|
||||||
apt-get update -y && \
|
apt-get update -y && \
|
||||||
apt-get install -y --no-install-recommends $buildDeps && \
|
apt-get install -y --no-install-recommends $buildDeps && \
|
||||||
npm update -g npm@3 && \
|
yarn install && \
|
||||||
npm install && npm cache clean && \
|
|
||||||
# cleanup
|
# cleanup
|
||||||
# apt-get purge -y $buildDeps && \
|
# apt-get purge -y $buildDeps && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
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_HOST 0.0.0.0
|
||||||
ENV SERVER_PORT 4000
|
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.
|
// This will make sure we can read the logs.
|
||||||
'--log-driver=json-file',
|
'--log-driver=json-file',
|
||||||
imageId,
|
imageId,
|
||||||
'/bin/sh -c "npm run build && npm run start"',
|
'/bin/sh -c "yarn build && yarn start"',
|
||||||
];
|
];
|
||||||
return exec('docker', runArgs);
|
return exec('docker', runArgs);
|
||||||
})
|
})
|
||||||
|
|
Загрузка…
Ссылка в новой задаче