title: How to deploy to AWS Beanstalk with GitLab CI
body: <p>How To Deploy a Node App on AWS Elastic Beanstalk, Docker, and Gitlab ci.</p>
  <p>I've created a simple node application. Dockerized the node application.</p>
  <p>What I'm trying to do is deploy my application using gitlab ci.</p>
  <p>This is what I have so far:</p>
  <pre><code>image: docker:git
  services:
    - docker:dind
  
  stages:
    - build
    - release
    - release-prod
  
  variables:
    CI_REGISTRY: registry.gitlab.com
    CONTAINER_TEST_IMAGE: registry.gitlab.com/testapp/routing:$CI_COMMIT_REF_NAME
    CONTAINER_RELEASE_IMAGE: registry.gitlab.com/testapp/routing:latest
  
  before_script:
    - echo &quot;$CI_REGISTRY_PASSWORD&quot; | docker login -u &quot;$CI_REGISTRY_USER&quot; --password-stdin &quot;$CI_REGISTRY&quot;
  
  build:
    stage: build
    script:
      - docker build -t $CONTAINER_TEST_IMAGE -f Dockerfile.prod .
      - docker push $CONTAINER_TEST_IMAGE
  
  release-image:
    stage: release
    script:
      - docker pull $CONTAINER_TEST_IMAGE
      - docker tag $CONTAINER_TEST_IMAGE $CONTAINER_RELEASE_IMAGE
      - docker push $CONTAINER_RELEASE_IMAGE
    only:
      - master
  
  release-prod:
    stage: release-prod
    script:
  
    when: manual
  
  </code></pre>
  <p>I'm stuck on release-prod stage. I'm just not sure how I can deploy the app to AWS Beanstalk.</p>
  <p>Since I have the docker images have been created and stored in gitlab registry. All I want to do is instruct AWS Beanstalk to download the docker images from gitlab registry and are start the application.</p>
  <p>I also have a <code>Dockerrun.aws.json</code> which defines the services.</p>