Dockerfile

Where you can copy and paste Dockerfile.

nginx

nginx

View

Download via npm

npm init dockerfile@latest nginx

Dockerfile

FROM nginx

COPY ./static/index.html /usr/share/nginx/html/index.html


nginx-php-74

nginx-php-74

View

Download via npm

npm init dockerfile@latest nginx-php-74

Dockerfile

FROM wyveo/nginx-php-fpm:php74

COPY index.php /usr/share/nginx/html/index.php


node-14

node-14

View

Download via npm

npm init dockerfile@latest node-14

Dockerfile

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

node-16

View

Download via npm

npm init dockerfile@latest node-16

Dockerfile

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

node-16-slim

View

Download via npm

npm init dockerfile@latest node-16-slim

Dockerfile

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

node-18-slim

View

Download via npm

npm init dockerfile@latest node-18-slim

Dockerfile

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

vite-html

View

Download via npm

npm init dockerfile@latest vite-html

Dockerfile

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/



View on GitHub