dylanlott
10/26/2016 - 10:55 PM

docker-compose.yml example for the Docker First Deploy Fast blog series

docker-compose.yml example for the Docker First Deploy Fast blog series

version: "2"
services: 
  web:
    build: . //build the web container from our current directory Dockerfile
    ports:
      - '8080:8080' //bind external ports to container ports 
    working_dir: '/app'
    command: npm run start //the command to run to start the container
    environment: 
      - MONGO_URI=mongodb://mongo:27017 //pass mongo conection string params to container
      - EXPRESS_PORT=8080 //set the port that Express listens on 
    volumes:
      - .:/app //pass local data into container folder 
    links:
      - mongo
      
  mongo:
    image: tutum/mongodb
    ports:
      - '27017:27017'
    environment: //we need to pass the auth env variables to setup auth for our container. 
      -