feat:deploy using container

This commit is contained in:
2025-09-27 11:53:36 +02:00
parent 9b4e956ad6
commit bbe68c6b0f
3 changed files with 71 additions and 12 deletions

43
Dockerfile Normal file
View File

@@ -0,0 +1,43 @@
# Use Node.js 18 alpine as base image
FROM node:18-alpine AS base
# Set working directory
WORKDIR /app
# Copy package files
COPY package.json ./
# Install dependencies
RUN npm install
# Copy source code
COPY . .
# Build the application
RUN npm run build
# Production stage
FROM node:18-alpine AS production
WORKDIR /app
# Copy package files
COPY package.json ./
# Install only production dependencies
RUN npm install --only=production
# Copy built application from build stage
COPY --from=base /app/build ./build
COPY --from=base /app/static ./static
COPY --from=base /app/package.json ./
# Expose port
EXPOSE 3000
# Set environment
ENV NODE_ENV=production
ENV PORT=3000
# Start the application
CMD ["node", "build"]