I want to create a docker compose in order to eliminate the number of commands needed to run my tests. My goal is to run ONE command and it will start my containers and run my tests. It's my first time creating a docker compose file so please be patient. The docker-compose.file is located next to the other two dockerfiles. Below is the docker-compose that I have initiated, but I can't even build the images. I have tried to specify path buy adding " volumes: -.:. " but it still does not work.
services:
headless-chrome:
build: ./Dockerfile-headless-chrome
dev-server:
build: ./Dockerfile
Traceback (most recent call last):
File "/usr/local/bin/docker-compose", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/site-packages/compose/cli/main.py", line 68, in main
command()
File "/usr/local/lib/python2.7/site-packages/compose/cli/main.py", line 118, in perform_command
handler(command, command_options)
File "/usr/local/lib/python2.7/site-packages/compose/cli/main.py", line 926, in up
scale_override=parse_scale_args(options['--scale']),
File "/usr/local/lib/python2.7/site-packages/compose/project.py", line 401, in up
svc.ensure_image_exists(do_build=do_build)
File "/usr/local/lib/python2.7/site-packages/compose/service.py", line 311, in ensure_image_exists
self.build()
File "/usr/local/lib/python2.7/site-packages/compose/service.py", line 888, in build
buildargs=build_args
File "/usr/local/lib/python2.7/site-packages/docker/api/build.py", line 137, in build
raise TypeError("You must specify a directory to build in path")
TypeError: You must specify a directory to build in path
version: "3"
In order to run the tests I use to do this: Shell 1:
$ SCHEME=http ENV=stage DOCKER_DEV_ENTRYPOINT='"npm run dev-server"' make docker-dev
When this is running, I need to run the below in a new shell (shell 2):
$ docker build -t headless-chrome -f Dockerfile-headless-chrome .
$ docker run -it --rm --net=host --cap-add=SYS_ADMIN headless-chrome /bin/bash
Then when Im inside the container Im running:
$ npm run selenium-docker
$ npm run uat