2021年1月7日星期四

How setup docker-compose without Dockerfile?

I have spend the last few hours trying to setup 2 default images of nodejs 14 and rethinkdb 2.3.5, so sorry if the tone is a little frustrated but I am currently frustrated.

My requirements are seemingly super simple.

I want to:

  1. download the default images for nodejs 14 and rethinkdb 2.3.5
  2. copy everything from my current directory into the nodejs 14 image.
  3. I want the nodejs image to depend on the RethinkDB image.
  4. run 2 commands in the nodejs 14 image; npm ci and npm test.
  5. see the stdout from the tests.

I do not need:

  1. any ports to be accessible to the host machine.
  2. to customize any Dockerfile or make any changes to the default images.
  3. any updates from the host machine file-system to the containers.
  4. to copy any data from the host machine to the RethinkDB container.

Why?

I want the tests to be reproducible across all developer machines - currently no CI. Regardless of where the developer has the project on their hard drive.

I have a single docker-compose.yml file.

version: "3"  services:    tests:      image: node:14      ports:        - "3000:3000"      # command:      #  - npm ci      #  - npm test      volumes:        - ".:/cli-app"      depends_on:        - rethinkdb      rethinkdb:      image: rethinkdb      ports:        - "28015:28015"        - "8080:8080"      volumes:        - "./data: /data"      command: rethinkdb --bindall --data /data  
https://stackoverflow.com/questions/65619962/how-setup-docker-compose-without-dockerfile January 08, 2021 at 05:07AM

没有评论:

发表评论