Cleanup container and reorder

This commit is contained in:
Jake Howard 2018-05-04 20:47:51 +01:00
parent c74f486b7e
commit 0ec819e232
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -1,11 +1,5 @@
FROM node:8.10.0-alpine FROM node:8.10.0-alpine
RUN mkdir -p /public
ENV NODE_ENV production
RUN apk add --no-cache git
COPY ./src /app/src COPY ./src /app/src
COPY ./package.json /app/package.json COPY ./package.json /app/package.json
COPY ./package-lock.json /app/package-lock.json COPY ./package-lock.json /app/package-lock.json
@ -13,11 +7,18 @@ COPY ./tsconfig.json /app/tsconfig.json
WORKDIR /app WORKDIR /app
RUN npm install --only=prod RUN mkdir -p /public
RUN npm install --only=dev
RUN apk add --no-cache git
RUN npm install
ENV NODE_ENV production
RUN npm run build RUN npm run build
RUN npm prune --production
CMD npm start -- /public CMD npm start -- /public
EXPOSE 5000 EXPOSE 5000