version: '2' services: nginxproxy: restart: always image: jwilder/nginx-proxy volumes: - /var/run/docker.sock:/tmp/docker.sock:ro ports: - "80:80" angular-app: image: "blobcity/angular-app:latest" restart: always environment: VIRTUAL_HOST: angular-app.blobcity.com VIRTUAL_PORT: 80 expose: - "80"
docker-compose.yml
The above docker-compose.yml file provides and Nginx proxy confirmation, that forwards to an AngularJS application. The above contents should be placed in a file called docker-compose.yml.
Replace image: “blobcity/angular-app:latest” with the image name of your application. It can be an AngularJS, NodeJS or any other docker based application.
Configure your domain, by replacing angular-app.blobcity.com with your domain.
To start Nginx and Angular app
> docker-compose up
To start as a daemon
> docker-compose up -d
To stop
> docker-compose stop