Enable prod node_env after npm install

This commit is contained in:
2017-02-13 18:12:21 +00:00
parent 5725161616
commit 7c9ba5744c

View File

@@ -1,6 +1,6 @@
FROM node:7.2.1-alpine
ENV NODE_ENV production
# Environment variables
ENV DATABASE_PATH db/wedding.db
ENV PORT 80
EXPOSE 80
@@ -9,8 +9,11 @@ EXPOSE 80
COPY ./ /usr/src/app
WORKDIR /usr/src/app
# Install dev dependencies and build release
# Install dev + prod dependencies and build release
RUN npm install --no-optional --silent
# Run production build
ENV NODE_ENV production
RUN npm run build --release --silent
WORKDIR /usr/src/app/build