feat:use selfhosted docker

This commit is contained in:
2025-12-16 12:59:43 +01:00
parent 577a3cab56
commit ae6a96d73b
5 changed files with 133 additions and 1 deletions

46
Dockerfile Normal file
View File

@@ -0,0 +1,46 @@
# Build stage
FROM node:20-alpine AS builder
# Install pnpm
RUN npm install -g pnpm
WORKDIR /app
# Copy package files
COPY package.json pnpm-lock.yaml ./
# Install dependencies
RUN pnpm install --frozen-lockfile
# Copy source code
COPY . .
# Build the app
RUN pnpm run build
# Production stage
FROM node:20-alpine
# Install pnpm
RUN npm install -g pnpm
WORKDIR /app
# Copy package files
COPY package.json pnpm-lock.yaml ./
# Install production dependencies only
RUN pnpm install --prod --frozen-lockfile
# Copy built app from builder
COPY --from=builder /app/build ./build
# Expose port
EXPOSE 3000
# Set environment variables
ENV NODE_ENV=production
ENV ORIGIN=http://localhost:3000
# Start the app
CMD ["node", "build"]