Running a react app with docker

Components:

  • Private Registry: needed to push your images to your server
  • Nginx Proxy Network: A reverse proxy that maps public domains to docker containers
  • A docker file to build your react app
  • Your app

Private registry

To create a private registry, use gbili/docker-private-registry. Follow the instructions in the README.md

Nginx Proxy Network

Use gbili/docker-nginx-proxy.

Build docker app image

sudo docker build -t myprivate-registry.com/username/image-name:0.0.version .
cd my-app # where the Dockerfile is

IMPORTANT: Don't miss the dot at the end