diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000000..763c421c133d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +node_modules +.next +.github \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000000..4c28415b04b8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +# Production Docker file +FROM node:18-alpine as builder + +WORKDIR /async + +COPY package.json package-lock.json scripts ./ + +RUN npm ci + +COPY . . +RUN npm run build + +FROM node:18-alpine AS PRODUCTION_STAGE +WORKDIR /async + +COPY --from=builder /async/package*.json ./ +COPY --from=builder /async/scripts ./ +COPY --from=builder /async/.next ./.next +COPY --from=builder /async/public ./public +COPY --from=builder /async/node_modules ./node_modules + +ENV NODE_ENV=production +EXPOSE 3000 +CMD ["npm", "start"] \ No newline at end of file diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 000000000000..42acadda2471 --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,19 @@ +# Development Docker file +FROM node:18-alpine as development + +WORKDIR /async + +# Install development dependencies +COPY package.json package-lock.json ./ +RUN npm install + +# Copy the rest of the application files +COPY . . + +# Expose the port for development (if needed) +EXPOSE 3000 + +# Set environment variables for development (optional) +ENV NODE_ENV=development + +CMD ["npm", "run", "dev"]