simple node app to test

This commit is contained in:
tusuii
2026-03-11 22:25:37 +05:30
commit 9c8f811cd4
8 changed files with 947 additions and 0 deletions

24
Dockerfile Normal file
View File

@@ -0,0 +1,24 @@
# Stage 1: Install production dependencies
FROM node:18-alpine AS deps
WORKDIR /usr/src/app
COPY package*.json ./
# Install only production dependencies
RUN npm install --omit=dev
# Stage 2: Final runtime image
FROM node:18-alpine AS runner
WORKDIR /usr/src/app
# Copy production dependencies from the 'deps' stage
COPY --from=deps /usr/src/app/node_modules ./node_modules
# Copy the application source code
COPY . .
# Set environment to production
ENV NODE_ENV=production
# Expose the application port
EXPOSE 3000
# Start the application
CMD ["node", "index.js"]