638969cd01
* yarn first go * fix frontend build cache loader * yarn workspaces built server Docker * build(yarn): add workspaces plugin config * chore(package defs): clean package*.json -s * chore(gitignore): ignore yarn error log * build(yarn): update yarn lock * build(preview-service webpack): add extra resolved path to preview service webpack config because of yarn package hoisting, there are no package level node_modules folder anymore. * build(docker): update dockerignore with yarn specific configs * build(docker): update Dockerfiles for yarn workspaces utilization * ci(circleci): update server test job to yarn * ci(circle): disable cache restore * ci(circleci): trying the node orb yarn-run * ci(circleci): yarn-run again * ci(circleci): disable node orb * ci(circleci): change base node image for tests * ci(circleci): add yarn cache * ci(circleci): remove node install step * ci(circleci): add server specific cache archives * ci(circleci): test build and publish * ci(circleci): change npm auth method to suit yarn * ci(circleci): trying new builder image * ci(circleci): another base image, maybe this works * ci(circleci): force a specific docker engine version * ci(circleci): add yarn version plugin and its changes * ci(circleci): cleanup and remove temp branch config * chore(package defs): moving from npm run to yarn * explicitly specifying webpack4 as a frontend dep * chore(package defs): replace npm with yarn everywhere * docs(root readme): update with some yarn specific docs * chore(root workspace): update dev scripts and package lock * ci(circleci): enable package publish step with yarn Co-authored-by: Fabians <fabis94@live.com>
33 lines
1.1 KiB
Docker
33 lines
1.1 KiB
Docker
# NOTE: Docker context should be set to git root directory, to include the viewer
|
|
|
|
# build stage
|
|
FROM node:16.13-bullseye-slim as build-stage
|
|
|
|
WORKDIR /speckle-server
|
|
COPY .yarnrc.yml .
|
|
COPY .yarn ./.yarn
|
|
COPY package.json yarn.lock ./
|
|
|
|
# Onyl copy in the relevant package.json files for the dependencies
|
|
COPY packages/frontend/package.json ./packages/frontend/
|
|
COPY packages/viewer/package.json ./packages/viewer/
|
|
COPY packages/objectloader/package.json ./packages/objectloader/
|
|
|
|
RUN yarn workspaces focus -A
|
|
|
|
# Onyl copy in the relevant source files for the dependencies
|
|
COPY packages/objectloader ./packages/objectloader/
|
|
COPY packages/viewer ./packages/viewer/
|
|
COPY packages/frontend ./packages/frontend/
|
|
|
|
# This way the foreach only builds the frontend and its deps
|
|
RUN yarn workspaces foreach -pt run build
|
|
|
|
# production stage
|
|
FROM openresty/openresty:1.19.9.1-bullseye as production-stage
|
|
COPY --from=build-stage /speckle-server/packages/frontend/dist /usr/share/nginx/html
|
|
RUN rm /etc/nginx/conf.d/default.conf
|
|
COPY packages/frontend/nginx/nginx.conf /etc/nginx/conf.d
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"]
|