Skip to content

Commit

Permalink
perf: Improving dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tommoor committed Sep 5, 2020
1 parent e7e289d commit f0712e2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
19 changes: 19 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -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
17 changes: 10 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
ENV NODE_ENV production
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

0 comments on commit f0712e2

Please sign in to comment.