title: Docker - docker compose two branches - Updated
body: <p>I'm new to using Docker.</p>
  
  <p>I'm using Dockerhub to link up with my GitHub repo. I have two branches on my GitHub repo: master and test. I want to know how to use <code>docker-compose</code> to specifically build either the master project (live) or the test project (development). Do I specify the tag name? when using:</p>
  
  <p><code>docker-compose up -d</code></p>
  
  <p>Because right now it only builds master project.</p>
  
  <p><a href="https://i.stack.imgur.com/V8ULn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/V8ULn.png" alt="enter image description here"></a></p>
  
  <p><strong>Updated docker-compose.yml</strong></p>
  
  <p>docker-compose.yml</p>
  
  <pre><code>version: '3.1'
  services:
    web:
      image: melkawakibi/blogandportfolio:latest
    links:
       - db
  
    web:
      image: melkawakibi/blogandportfolio:test
    links:
       - db
  
    db:
      image: mysql:5.6
      environment:
        MYSQL_ROOT_PASSWORD: ""
        MYSQL_DATABASE: ""
        MYSQL_USER: ""
  </code></pre>
  
  <p>dockerfile</p>
  
  <pre><code>FROM hitalos/laravel
  
  RUN git config --system http.sslverify false
  
  RUN git clone @github.com/melkawakibi/blogandportfolio.git /var/www
  
  RUN cp .env.production .env
  
  # Run Compser Install
  RUN composer install -d /var/www
  RUN php /var/www/artisan key:generate
  
  WORKDIR /var/www
  
  CMD php /var/www/artisan serve --port=80 --host=0.0.0.0
  EXPOSE 80
  </code></pre>