Skip to content

Instantly share code, notes, and snippets.

@aaronromeo
Created May 28, 2019 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronromeo/42e33c63b403191e9e4915382451d414 to your computer and use it in GitHub Desktop.
Save aaronromeo/42e33c63b403191e9e4915382451d414 to your computer and use it in GitHub Desktop.
Getting Cypress to wait for the server to start
FROM cypress/included:3.3.0
RUN apt-get update && apt-get install -y wget
ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
RUN npm install cypress-image-snapshot@3.0.2
...
cypress:
build:
context: .
dockerfile: cypress.Dockerfile
depends_on:
- frontend
- mailcatcher
environment:
- CYPRESS_baseUrl=http://frontend:3030
entrypoint: >
/bin/sh -c '
which cypress
dockerize -wait tcp://frontend:3030 -timeout 300s
cypress run
'
working_dir: /apps/sut
volumes:
- ../../sut:/apps/sut
networks:
- default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment