perf: Improving dockerfile

This commit is contained in:
Tom Moor 2020-09-05 12:44:40 -07:00
parent e7e289d9fa
commit f0712e22d8
2 changed files with 29 additions and 7 deletions

19
.dockerignore Normal file
View File

@ -0,0 +1,19 @@
__mocks__
.git
.vscode
.github
.circleci
.DS_Store
.env*
.eslint*
.flowconfig
.log
Makefile
Procfile
app.json
build
docker-compose.yml
fakes3
flow-typed
node_modules
setupJest.js

View File

@ -1,18 +1,21 @@
FROM node:14-alpine
ENV PATH /opt/outline/node_modules/.bin:/opt/node_modules/.bin:$PATH
ENV NODE_PATH /opt/outline/node_modules:/opt/node_modules
ENV APP_PATH /opt/outline
RUN mkdir -p $APP_PATH
WORKDIR $APP_PATH
COPY . $APP_PATH
RUN yarn install --pure-lockfile
RUN yarn build
RUN cp -r /opt/outline/node_modules /opt/node_modules
COPY package.json ./
COPY yarn.lock ./
RUN yarn --pure-lockfile
COPY . .
RUN yarn build && \
yarn --production --ignore-scripts --prefer-offline
ENV NODE_ENV production
CMD yarn start
EXPOSE 3000