Dockerfile React - keshavbaweja-git/guides GitHub Wiki

Dockerfile

FROM nginx
EXPOSE 3000
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf
COPY ./build /usr/share/nginx/html
RUN chown -R nginx:nginx /usr/share/nginx/html/

nginx/default.conf

server {
  listen 3000;

  location / {
    root /usr/share/nginx/html;
    index index.html index.htm;
    add_header Cache-Control "private, no-cache, no-store, must-revalidate";
    add_header Expires "Sat, 01 Jan 2000 00:00:00 GMT";
    add_header Pragma no-cache;
  }
}