Sign inSign up

fitiavana07/nginx-react

By fitiavana07

•Updated almost 6 years ago

Nginx image with configuration for serving react built projects

Image
0

10K+

fitiavana07/nginx-react repository overview

⁠docker-react

Docker image for React

⁠How to use this image

# The first image is for compiling the client files, the second is for serving.

# BUILD IMAGE
FROM node:14-alpine as build-stage

WORKDIR /app

# Install dependencies
COPY package*.json ./
RUN npm install

# Build
COPY . .
RUN npm run build

# -----------------------------------------------------------------------------
# SERVING IMAGE
FROM fitiavana07/nginx-react

# Copy built files
COPY --from=build-stage /app/build /usr/share/nginx/html

# 80 for HTTP
EXPOSE 80

# Run nginx
CMD nginx -g 'daemon off;'

Tag summary

Content type

Image

Digest

Size

9.1 MB

Last updated

almost 6 years ago

docker pull fitiavana07/nginx-react