mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-08 18:22:40 +00:00
Adjust Dockerfile to improve caching
This commit is contained in:
committed by
Trevor Buckner
parent
f57c0f0886
commit
354a5832e4
15
Dockerfile
15
Dockerfile
@@ -1,14 +1,19 @@
|
|||||||
FROM node:8
|
FROM node:8
|
||||||
|
|
||||||
|
ENV NODE_ENV=docker
|
||||||
|
|
||||||
# Create app directory
|
# Create app directory
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# Bundle app source
|
# Copy package.json into the image, then run yarn install
|
||||||
|
# This improves caching so we don't have to download the dependencies every time the code changes
|
||||||
|
COPY package.json ./
|
||||||
|
# --ignore-scripts tells yarn not to run postbuild. We run it explicitly later
|
||||||
|
RUN yarn install --ignore-scripts
|
||||||
|
|
||||||
|
# Bundle app source and build application
|
||||||
COPY . .
|
COPY . .
|
||||||
|
RUN yarn build
|
||||||
ENV NODE_ENV=docker
|
|
||||||
|
|
||||||
RUN yarn
|
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
CMD [ "yarn", "start" ]
|
CMD [ "yarn", "start" ]
|
||||||
Reference in New Issue
Block a user