Skip to content

Commit

Permalink
wip: add more dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Dec 11, 2024
1 parent 0eb1514 commit 2056f70
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 0 deletions.
51 changes: 51 additions & 0 deletions apps/package-manager/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
51 changes: 51 additions & 0 deletions apps/workforce/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
1 change: 1 addition & 0 deletions shared/packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
Expand Down

0 comments on commit 2056f70

Please sign in to comment.