Create Dockerfile for Railway deployment

cgen-eb4e617693514a0cb6a5135ff443854a
This commit is contained in:
Builder.io 2025-11-16 10:59:29 +00:00
parent 252e0ac577
commit 9fd6918a2f

27
Dockerfile Normal file
View file

@ -0,0 +1,27 @@
FROM node:22-alpine
WORKDIR /app
# Copy package files
COPY package.json package-lock.json* pnpm-lock.yaml* npm-shrinkwrap.json* ./
# Install dependencies
RUN if [ -f pnpm-lock.yaml ]; then npm install -g pnpm && pnpm install --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \
else npm install; fi
# Copy source code
COPY . .
# Build the app (frontend + server)
RUN npm run build
# Set environment
ENV NODE_ENV=production
ENV PORT=3000
# Expose port
EXPOSE 3000
# Start the server
CMD ["npm", "start"]