Skip to content

Instantly share code, notes, and snippets.

@TahirNaushad
Last active September 29, 2017 09:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TahirNaushad/c9cccdaf0748a3b25c3bbc922269c7bb to your computer and use it in GitHub Desktop.
Save TahirNaushad/c9cccdaf0748a3b25c3bbc922269c7bb to your computer and use it in GitHub Desktop.
Docker Stack File Example

ASP.NET Core and Docker Swarm

Below is a compose file for my blog post here

version: '3.3'

services:
  viz: 
    image: dockersamples/visualizer
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    ports:
      - "8070:8080"
    deploy:
      placement:
        constraints:
          - node.role == manager
  api:
    image: naushadt25/api
    ports:
      - "8080:80"
    environment:
      MOVIES_DB_CONN: "..."
    deploy:
      replicas: 3
  web:
    image: naushadt25/web
    ports:
      - "8090:80"
    environment:
      API_URL: "http://api/movies"
    depends_on:
      - api
    deploy:
      replicas: 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment