<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>

CC BY-SA 3.0
2018-02-24T15:28:16.737Z
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.
ydaetskcoR
CC BY-SA 3.0
2018-02-26T16:28:48.733Z
@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?
Vitaliy Filipov
CC BY-SA 4.0
2019-12-23T08:54:59.580Z
Could you indicate whether you solved the issue?
030
<amazon-web-services><docker-compose><dockerfile><aws-elb><aws-codedeploy>
How to deploy with AWS CodePipeline a multicontainer docker environment without dockerfile
Vitaliy Filipov
# 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 although CodePipeline is expecting some build artifact:

**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

