Files
shields/Dockerfile
Paul Melnikow ace2a7a695 Tweak Docker initialization (#3173)
* Tweak Docker initialization

1. Set NODE_ENV=production in Docker.
2. When NODE_ENV is production, bind to all interfaces. This seems like a
   sensible default.
3. Exclude Dockerfile from container to improve layer cacheability when
   modifying the dockerfile.

Ref #3165

* Rm obsolete comment
2019-03-06 21:15:03 -06:00

27 lines
592 B
Docker

FROM node:8-alpine
RUN apk add --no-cache gettext imagemagick librsvg git
RUN mkdir -p /usr/src/app
RUN mkdir /usr/src/app/private
WORKDIR /usr/src/app
COPY package.json package-lock.json /usr/src/app/
# Without the gh-badges package.json and CLI script in place, `npm ci` will fail.
COPY gh-badges /usr/src/app/gh-badges/
# We need dev deps to build the front end.
RUN NODE_ENV=development npm ci
COPY . /usr/src/app
RUN npm run build
RUN npm prune --production
RUN npm cache clean --force
# Run the server using production configs.
ENV NODE_ENV production
CMD node server
EXPOSE 80