Nginx + Private Docker Registry
This Docker Compose file sets up two services: a Docker registry and an Nginx reverse proxy. The registry service uses the official Docker registry image and is configured with basic authentication using htpasswd. The Nginx service acts as a reverse proxy, handling SSL termination and forwarding requests to the registry.
Generate an htpasswd file for authentication:
docker run --entrypoint htpasswd registry:2 -Bbn username password > auth/htpasswdOr install locally if on Ubuntu:
sudo apt install apache2-utilsThen create your password:
htpasswd -Bbn [username] [password] > auth/htpasswdNote: Replace [username] and [password] with your custom username and password.
Clone the .env.example file as .env and configure environment variables.
Clone nginx.conf as nginx-custom.conf and set domain-specific configurations.
Start the services with:
docker-compose up -dNote: Adjust all configuration settings, such as domain names, proxy rules, and other parameters according to your specific needs.