From 2056f7020b2b58fa708ea021e69d4d65d5d749af Mon Sep 17 00:00:00 2001 From: Julian Waller Date: Wed, 11 Dec 2024 11:57:57 +0000 Subject: [PATCH] wip: add more dockerfiles --- apps/package-manager/app/Dockerfile | 51 +++++++++++++++++++++++++++++ apps/workforce/app/Dockerfile | 51 +++++++++++++++++++++++++++++ shared/packages/api/package.json | 1 + 3 files changed, 103 insertions(+) create mode 100644 apps/package-manager/app/Dockerfile create mode 100644 apps/workforce/app/Dockerfile diff --git a/apps/package-manager/app/Dockerfile b/apps/package-manager/app/Dockerfile new file mode 100644 index 00000000..17092087 --- /dev/null +++ b/apps/package-manager/app/Dockerfile @@ -0,0 +1,51 @@ +FROM node:18-alpine as builder + +# Note: Build this from the root directory: +# cd package-manager +# docker build -f apps/package-manager/app/Dockerfile -t pm-package-manager . +# docker build -t pm-package-manager ../../../.. + +# Environment + +WORKDIR /src + +# Common + +COPY package.json tsconfig.json tsconfig.build.json yarn.lock lerna.json commonPackage.json .yarnrc.yml ./ +COPY scripts ./scripts +COPY .yarn ./.yarn + +# Shared dependencies +COPY shared ./shared + + +# App dependencies +RUN mkdir -p apps/package-manager +COPY apps/package-manager/packages apps/package-manager/packages + +# App +COPY apps/package-manager/app apps/package-manager/app + +# Install +RUN yarn install + +# Build +RUN yarn build + +# Purge dev-dependencies: +RUN yarn workspaces focus -A --production + +RUN rm -r scripts + + +# Create deploy-image: +FROM node:18-alpine + +COPY --from=builder /src /src + + +WORKDIR /src/apps/package-manager/app +ENV package-manager_PORT=8070 +EXPOSE 8070 + +CMD ["yarn", "start"] diff --git a/apps/workforce/app/Dockerfile b/apps/workforce/app/Dockerfile new file mode 100644 index 00000000..6bf435d0 --- /dev/null +++ b/apps/workforce/app/Dockerfile @@ -0,0 +1,51 @@ +FROM node:18-alpine as builder + +# Note: Build this from the root directory: +# cd package-manager +# docker build -f apps/workforce/app/Dockerfile -t pm-workforce . +# docker build -t pm-workforce ../../../.. + +# Environment + +WORKDIR /src + +# Common + +COPY package.json tsconfig.json tsconfig.build.json yarn.lock lerna.json commonPackage.json .yarnrc.yml ./ +COPY scripts ./scripts +COPY .yarn ./.yarn + +# Shared dependencies +COPY shared ./shared + + +# App dependencies +RUN mkdir -p apps/workforce +COPY apps/workforce/packages apps/workforce/packages + +# App +COPY apps/workforce/app apps/workforce/app + +# Install +RUN yarn install + +# Build +RUN yarn build + +# Purge dev-dependencies: +RUN yarn workspaces focus -A --production + +RUN rm -r scripts + + +# Create deploy-image: +FROM node:18-alpine + +COPY --from=builder /src /src + + +WORKDIR /src/apps/workforce/app +ENV WORKFORCE_PORT=8070 +EXPOSE 8070 + +CMD ["yarn", "start"] diff --git a/shared/packages/api/package.json b/shared/packages/api/package.json index 7b4c6839..6a7ec3f7 100644 --- a/shared/packages/api/package.json +++ b/shared/packages/api/package.json @@ -16,6 +16,7 @@ "@sofie-automation/shared-lib": "*" }, "devDependencies": { + "@types/underscore": "^1.10.24", "@types/winston": "^2.3.9", "@types/ws": "^8.5.4", "jest": "*",