Files
colanode/apps/server/Dockerfile

36 lines
826 B
Docker
Raw Permalink Normal View History

2025-06-11 12:31:52 +02:00
FROM node:22-alpine
2024-10-06 00:34:25 +02:00
WORKDIR /app
# Copy root workspace files
COPY package.json package-lock.json ./
2024-12-04 23:12:25 +01:00
# Copy scripts
COPY ../../scripts scripts
# Copy all package.json files first
COPY ../../packages/core/package.json packages/core/package.json
COPY ../../packages/crdt/package.json packages/crdt/package.json
COPY ../../apps/server/package.json apps/server/package.json
2024-10-06 00:34:25 +02:00
# Install dependencies
RUN npm ci
# Copy source files
COPY ../../packages/core packages/core
COPY ../../packages/crdt packages/crdt
COPY ../../apps/server apps/server
COPY ../../tsconfig.base.json ./
2024-10-06 00:34:25 +02:00
# Build packages
RUN npm run build -w @colanode/core && \
npm run build -w @colanode/crdt && \
npm run build -w @colanode/server && \
npm prune --production
2024-10-06 00:34:25 +02:00
ENV NODE_ENV=production
2024-10-06 00:34:25 +02:00
EXPOSE 3000
CMD ["node", "apps/server/dist/index.js"]