FROM node:10-alpine as build-step
# Set working directory
WORKDIR /var/www/Front-End-App
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
COPY package.json /app
RUN npm install
# Copy existing application directory contents
COPY . /var/www/Front-End-App
# Copy existing application directory permissions
COPY --chown=www:www . /var/www/Front-End-App
# Change current user to www
USER www
RUN npm run build
FROM nginx:1.17.1-alpine
COPY --from=build-step /app/build /usr/share/nginx/html
|