2

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:

AWS CodePipeline staging step wants a build artifact

3
  • 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. Commented Feb 24, 2018 at 15:28
  • @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? Commented Feb 26, 2018 at 16:28
  • Could you indicate whether you solved the issue? Commented Dec 23, 2019 at 8:54

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.