Skip to content

Latest commit

 

History

History
29 lines (25 loc) · 706 Bytes

DEPLOYMENT.md

File metadata and controls

29 lines (25 loc) · 706 Bytes

Deployment

Dockerize

Just create a Docker file and send it to any platform.

FROM node:18.15.0-alpine as builder
# Set the working directory to /app inside the container
WORKDIR /app
# Copy app files
COPY . .
# Install dependencies (npm ci makes sure the exact versions in the lockfile gets installed)
RUN npm ci 
# Build the app
RUN npm run build

# Bundle static assets with nginx
FROM nginx:1.21.0-alpine as production
ENV NODE_ENV production
# Copy built assets from `builder` image
COPY --from=builder /app/build /usr/share/nginx/html
# Add your nginx.conf
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port
EXPOSE 80
# Start nginx
CMD ["nginx", "-g", "daemon off;"]