Created
December 19, 2017 12:25
-
-
Save TheDeveloper/4a513424473c24b28c93aab1b70feb74 to your computer and use it in GitHub Desktop.
Docker compose configuration for testing a nodejs app container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test: | |
image: "${APP_IMAGE}" | |
links: | |
- es | |
- redis | |
environment: | |
- NODE_ENV=test | |
- ES_HOST=es | |
- REDIS_HOST=redis | |
command: | | |
/bin/sh -c " | |
export REDIS_PORT=$$REDIS_PORT_6379_TCP_PORT | |
export ES_PORT=$$ES_PORT_9200_TCP_PORT | |
npx mocha --exit --require babel-register --no-colors ./src/test/*.js | |
" | |
es: | |
image: elasticsearch:2.3.5 | |
command: elasticsearch -Des.http.compression=true -Des.http.cors.enabled=true -Des.http.cors.allow-origin="*" -Des.script.inline=true -Des.script.indexed=true | |
ports: | |
- "9234:9200" | |
environment: | |
- ES_HEAP_SIZE=500M | |
container_name: es | |
redis: | |
image: redis:alpine | |
ports: | |
- "5387:6379" | |
container_name: redis |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment