Merge branch 'madlittlemods/2308-follow-up' into 'develop'
[gitter.git] / Dockerfile-app-base
blob07b439867aa36cd315eb10459abf80b3847dcf01
1 FROM registry.gitlab.com/gitterhq/webapp:latest
3 WORKDIR /app
5 COPY output/app.tar.gz /tmp/app.tar.gz
7 RUN tar -xvzf /tmp/app.tar.gz -C /app && \
8     rm -rf node_modules npm-shrinkwrap.json package-lock.json && \
9     # node-gyp dependencies
10     apt-get update && \
11     apt-get install -y --no-install-recommends python g++ && \
12     # Normally we use `npm install --production` but we need the
13     # devDependencies(like webpack) installed so we can run in NODE_ENV=test-docker
14     npm install && \
15     # via https://github.com/nodejs/docker-node/blob/1d6a051d71e817f3947612a260ddcb02e48c2f74/10/buster-slim/Dockerfile#L53
16     apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false python g++
19 RUN rm -rf /tmp/* /npm_cache /var/cache/apk/* /root/.npm /root/.node-gyp /root/.gnupg /root/.ssh 2>/dev/null
21 EXPOSE 5000
23 HEALTHCHECK --interval=2s --timeout=5s --retries=3 --start-period=20s \
24   CMD npm run health-check
26 CMD ["/bin/bash", "-c", "node web.js"]