-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,33 @@ | ||
FROM node:22-alpine | ||
FROM node:22-alpine AS builder | ||
|
||
WORKDIR /app | ||
|
||
RUN apk add --no-cache ffmpeg | ||
|
||
COPY package.json yarn.lock .yarnrc.yml tsconfig.json ./ | ||
COPY .yarn .yarn | ||
COPY server/ server/ | ||
COPY server server | ||
|
||
RUN corepack enable && \ | ||
yarn install | ||
RUN corepack enable | ||
RUN yarn install | ||
|
||
WORKDIR /app/server | ||
RUN yarn install | ||
RUN yarn build | ||
|
||
FROM node:22-alpine | ||
|
||
WORKDIR /app | ||
|
||
RUN apk add --no-cache ffmpeg | ||
RUN corepack enable | ||
|
||
COPY --from=builder /app/server/package.json ./package.json | ||
COPY --from=builder /app/yarn.lock ./yarn.lock | ||
COPY --from=builder /app/.yarnrc.yml ./.yarnrc.yml | ||
COPY --from=builder /app/.yarn ./.yarn | ||
COPY --from=builder /app/server/dist ./dist | ||
COPY server/.env ./.env | ||
|
||
RUN yarn workspaces focus --production --all | ||
|
||
EXPOSE 3000 | ||
CMD ["yarn", "start"] | ||
CMD ["node", "dist/main.js"] |