Sign inSign up

hereshem/nginx

By hereshem

Updated almost 2 years ago

Nginx image for serving static build content from react, vue and other html sources

Image
0

3.6K

hereshem/nginx repository overview

Nginx image is targeted for react and vue js frontend serving

This image can be used with multiple methods

Serve static content
docker run --name=web --restart=always -v `pwd`:/usr/share/nginx/html -p 8080:80 hereshem/nginx
Run using docker-compose
version: "3"
services:
  web:
    image: hereshem/nginx
    ports:
      - "8080:80"
    restart: always
    volumes:
      - ./:/usr/share/nginx/html
Building new image using Dockerfile
FROM node:14 AS build
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build

# production stage
FROM hereshem/nginx:latest as prod
COPY --from=build /app/dist /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]

Tag summary

Content type

Image

Digest

Size

9.6 MB

Last updated

over 4 years ago

docker pull hereshem/nginx