Skip to content

Commit f0712e2

Browse files
committed
perf: Improving dockerfile
1 parent e7e289d commit f0712e2

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed

.dockerignore

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
__mocks__
2+
.git
3+
.vscode
4+
.github
5+
.circleci
6+
.DS_Store
7+
.env*
8+
.eslint*
9+
.flowconfig
10+
.log
11+
Makefile
12+
Procfile
13+
app.json
14+
build
15+
docker-compose.yml
16+
fakes3
17+
flow-typed
18+
node_modules
19+
setupJest.js

Dockerfile

+10-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
FROM node:14-alpine
22

3-
ENV PATH /opt/outline/node_modules/.bin:/opt/node_modules/.bin:$PATH
4-
ENV NODE_PATH /opt/outline/node_modules:/opt/node_modules
53
ENV APP_PATH /opt/outline
64
RUN mkdir -p $APP_PATH
75

86
WORKDIR $APP_PATH
9-
COPY . $APP_PATH
107

11-
RUN yarn install --pure-lockfile
12-
RUN yarn build
13-
RUN cp -r /opt/outline/node_modules /opt/node_modules
14-
ENV NODE_ENV production
8+
COPY package.json ./
9+
COPY yarn.lock ./
10+
11+
RUN yarn --pure-lockfile
12+
13+
COPY . .
1514

15+
RUN yarn build && \
16+
yarn --production --ignore-scripts --prefer-offline
17+
18+
ENV NODE_ENV production
1619
CMD yarn start
1720

1821
EXPOSE 3000

0 commit comments

Comments
 (0)