Where you can copy and paste Dockerfile.
nginx
npm init dockerfile@latest nginx
FROM nginx
COPY ./static/index.html /usr/share/nginx/html/index.html
nginx-php-74
npm init dockerfile@latest nginx-php-74
FROM wyveo/nginx-php-fpm:php74
COPY index.php /usr/share/nginx/html/index.php
node-14
npm init dockerfile@latest node-14
FROM node:14-alpine
# Create a new directory for the project
RUN mkdir -p /opt/app
# Change current working directory
WORKDIR /opt/app
# Copy package files
COPY package*.json ./
# Set our env to be in CI
ENV CI true
ENV NODE_ENV production
RUN npm ci
# Copy our project files
COPY . .
# Change directory's owner
RUN chown -R node /opt/app
# Specify running user
USER node
# Port of the application
EXPOSE 8080
CMD [ "node", "main.js" ]
node-16
npm init dockerfile@latest node-16
FROM node:16-alpine
# Create a new directory for the project
RUN mkdir -p /opt/app
# Change current working directory
WORKDIR /opt/app
# Copy package files
COPY package*.json ./
# Set our env to be in CI
ENV CI true
ENV NODE_ENV production
RUN npm ci
# Copy our project files
COPY . .
# Change directory's owner
RUN chown -R node /opt/app
# Specify running user
USER node
# Port of the application
EXPOSE 8080
CMD [ "node", "main.js" ]
node-16-slim
npm init dockerfile@latest node-16-slim
FROM node:16-slim
# Create a new directory for the project
RUN mkdir -p /opt/app
# Change current working directory
WORKDIR /opt/app
# Copy package files
COPY package*.json ./
# Set our env to be in CI
ENV CI true
ENV NODE_ENV production
RUN npm ci
# Copy our project files
COPY . .
# Change directory's owner
RUN chown -R node /opt/app
# Specify running user
USER node
# Port of the application
EXPOSE 8080
CMD [ "node", "main.js" ]
node-18-slim
npm init dockerfile@latest node-18-slim
FROM node:18-slim
# Create a new directory for the project
RUN mkdir -p /opt/app
# Change current working directory
WORKDIR /opt/app
# Copy package files
COPY package*.json ./
# Set our env to be in CI
ENV CI true
ENV NODE_ENV production
RUN npm ci
# Copy our project files
COPY . .
# Change directory's owner
RUN chown -R node /opt/app
# Specify running user
USER node
# Port of the application
EXPOSE 8080
CMD [ "node", "main.js" ]
vite-html
npm init dockerfile@latest vite-html
FROM node:16-slim as builder
RUN mkdir -p /opt/app
WORKDIR /opt/app
COPY package*.json ./
RUN npm ci
COPY . .
RUN chown -R node /opt/app
RUN npm run build
FROM nginx
COPY --from=builder /opt/app/dist/* /usr/share/nginx/html/
RUN chown -R nginx /usr/share/nginx/html/