-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose-test.yml
More file actions
37 lines (37 loc) · 1.42 KB
/
docker-compose-test.yml
File metadata and controls
37 lines (37 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
version: '3.7'
services:
test_server:
build:
context: ./server
dockerfile: Dockerfile.test
container_name: test_server
volumes:
- ./server:/server-tests
environment:
- RASA_ENDPOINT=${RASA_ENDPOINT}
- SERVER_PORT=${SERVER_PORT}
- MONGO_CONNECTION_STRING=${MONGO_CONNECTION_STRING}
- MONGO_CONNECTION_STRING_ADMIN=${MONGO_CONNECTION_STRING_ADMIN}
- SERVER_UPLOAD_DIR=${SERVER_UPLOAD_DIR}
# script to wait for mongo to be fully up & running
- WAIT_HOSTS=db:${MONGO_PORT}
depends_on:
- db
restart: on-failure
db:
image: mongo:latest
volumes:
# Use a different dir to separate testing data from dev (or prod) data
- $TEST_DATABASE_DATA:/$TEST_DATABASE_DATA
# Put the script to initialise the database in the right directory withing mongo container
# It will execute it on initialisation
- ./init-db.js:/docker-entrypoint-initdb.d/init-db.js:ro
environment:
- MONGO_INITDB_DATABASE=${MONGO_INITDB_DATABASE}
- MONGO_INITDB_ROOT_USERNAME=${MONGO_INITDB_ROOT_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_INITDB_ROOT_PASSWORD}
ports:
- "${MONGO_PORT}:${MONGO_PORT}"
restart: on-failure
expose:
- ${MONGO_PORT}