mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
55 lines
1.5 KiB
Docker
55 lines
1.5 KiB
Docker
FROM node:22-alpine AS builder
|
|
|
|
WORKDIR /build
|
|
|
|
# Copy LICENSE file.
|
|
COPY LICENSE ./
|
|
|
|
# Copy the relevant package.json and package-lock.json files.
|
|
COPY package*.json ./
|
|
COPY packages/server/package*.json ./packages/server/
|
|
COPY packages/core/package*.json ./packages/core/
|
|
COPY packages/frontend/package*.json ./packages/frontend/
|
|
|
|
# Install dependencies.
|
|
RUN npm install
|
|
|
|
# Copy source files.
|
|
COPY tsconfig.*json ./
|
|
|
|
COPY packages/server ./packages/server
|
|
COPY packages/core ./packages/core
|
|
COPY packages/frontend ./packages/frontend
|
|
COPY scripts ./scripts
|
|
COPY resources ./resources
|
|
|
|
|
|
# Build the project.
|
|
RUN npm run build
|
|
|
|
# Remove development dependencies.
|
|
RUN npm --workspaces prune --omit=dev
|
|
|
|
FROM node:22-alpine AS final
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy the built files from the builder.
|
|
# The package.json files must be copied as well for NPM workspace symlinks between local packages to work.
|
|
COPY --from=builder /build/package*.json /build/LICENSE ./
|
|
|
|
COPY --from=builder /build/packages/core/package.*json ./packages/core/
|
|
COPY --from=builder /build/packages/frontend/package.*json ./packages/frontend/
|
|
COPY --from=builder /build/packages/server/package.*json ./packages/server/
|
|
|
|
COPY --from=builder /build/packages/core/out ./packages/core/out
|
|
COPY --from=builder /build/packages/frontend/out ./packages/frontend/out
|
|
COPY --from=builder /build/packages/server/dist ./packages/server/dist
|
|
|
|
COPY --from=builder /build/resources ./resources
|
|
|
|
COPY --from=builder /build/node_modules ./node_modules
|
|
|
|
EXPOSE 3000
|
|
|
|
ENTRYPOINT ["npm", "run", "start"] |