diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000000..9a2b306ca53c --- /dev/null +++ b/.dockerignore @@ -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 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index c43fb0e77309..68272a747a8a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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