Body: <p>I'm using simple docker-compose container images. Here's my <code>docker-compose.yml</code></p>
  
  <pre><code>    version: '2'
  
      services:
        db:
          image: postgres:10.2
          ports:
            - "5432:5432"
          environment:
            ... skipped for brevity
          volumes:
            - "./server:/docker-entrypoint-initdb.d"
  
        postgrest:
          image: postgrest/postgrest
          ports:
            - "3000:3000"
          environment:
           ... skipped for brevity
  
        webapp:
          image: node:8.9
          ports:
            - "3001:3001"
          volumes:
            - "./client:/client"
            - "./package.json:/client/package.json"
            - "./node_modules:/client/node_modules"
          environment:
            - API_URL=${API_URL}
          working_dir: /client
          command: npm run dev -- -p 3001
  </code></pre>
  
  <p>which I want to deploy to AWS Elasticbeanstalk using CodePipeline. As I don't have any build step (thus no Dockerfile) I'm wondering how to instruct my <code>buildspec.yml</code> </p>
  
  <pre><code>    version: 0.2
  
      phases:
        install:
          commands:
            - echo starting on `date`
            - npm install
        pre_build:
          commands:
            - cp .env.example .env
        build:
          commands:
            - docker-compose up -d
  
        post_build:
          commands:
            - echo completing on `date`
  </code></pre>
  
  <p>to properly build using docker-compose?</p>
  
  <p>I believe I just need a <a href="https://gist.github.com/altras/9b0fbd6ba39b2de0e83332c4e17f0d0c" rel="nofollow noreferrer"><code>Dockerrun.aws.json</code> file</a> although CodePipeline is expecting some build artifact:</p>
  
  <p><a href="https://i.sstatic.net/71kVz.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/71kVz.png" alt="AWS CodePipeline staging step wants a build artifact"></a></p>
  
Comments: CC BY-SA 3.0
Comments: 2018-02-24T15:28:16.737Z
Comments: Bind mounting your application code into your container only helps you when it's running on a machine that has the code on it. You need to build a Docker image with your application in it for it to actually work elsewhere.
Comments: ydaetskcoR
Comments: CC BY-SA 3.0
Comments: 2018-02-26T16:28:48.733Z
Comments: @ydaetskcoR so I can use `docker pull ...` and `docker save` in order to have all images saved as `.tar` file and push that to AWS?
Comments: Vitaliy Filipov
Comments: CC BY-SA 4.0
Comments: 2019-12-23T08:54:59.580Z
Comments: Could you indicate whether you solved the issue?
Comments: 030
Tags: <amazon-web-services><docker-compose><dockerfile><aws-elb><aws-codedeploy>
Title: How to deploy with AWS CodePipeline a multicontainer docker environment without dockerfile
UserDisplayName: Vitaliy Filipov
ThreadText: # How to deploy with AWS CodePipeline a multicontainer docker environment without dockerfile
  
  (Asked by: username_0 on 2018-02-22)
  
  I'm using simple docker-compose container images. Here's my `docker-compose.yml`
  
  ```
      version: '2'
  
      services:
        db:
          image: postgres:10.2
          ports:
            - "5432:5432"
          environment:
            ... skipped for brevity
          volumes:
            - "./server:/docker-entrypoint-initdb.d"
  
        postgrest:
          image: postgrest/postgrest
          ports:
            - "3000:3000"
          environment:
           ... skipped for brevity
  
        webapp:
          image: node:8.9
          ports:
            - "3001:3001"
          volumes:
            - "./client:/client"
            - "./package.json:/client/package.json"
            - "./node_modules:/client/node_modules"
          environment:
            - API_URL=${API_URL}
          working_dir: /client
          command: npm run dev -- -p 3001
  
  ```
  
  which I want to deploy to AWS Elasticbeanstalk using CodePipeline. As I don't have any build step (thus no Dockerfile) I'm wondering how to instruct my `buildspec.yml`
  
  ```
      version: 0.2
  
      phases:
        install:
          commands:
            - echo starting on `date`
            - npm install
        pre_build:
          commands:
            - cp .env.example .env
        build:
          commands:
            - docker-compose up -d
  
        post_build:
          commands:
            - echo completing on `date`
  
  ```
  
  to properly build using docker-compose?
  
  I believe I just need a [`Dockerrun.aws.json` file](https://gist.github.com/altras/9b0fbd6ba39b2de0e83332c4e17f0d0c) although CodePipeline is expecting some build artifact:
  
  [![AWS CodePipeline staging step wants a build artifact](https://i.sstatic.net/71kVz.png)](https://i.sstatic.net/71kVz.png)
  
  **Tags:** amazon-web-services, docker-compose, dockerfile, aws-elb, aws-codedeploy
  
  > **Comments:**
  > **username_1**: Bind mounting your application code into your container only helps you when it's running on a machine that has the code on it. You need to build a Docker image with your application in it for it to actually work elsewhere.  
  > **username_0**: @username_1 so I can use `docker pull ...` and `docker save` in order to have all images saved as `.tar` file and push that to AWS?  
  > **username_2**: Could you indicate whether you solved the issue?  
  
  ---
  
  ## 0 answers
  
  