-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
67 lines (64 loc) · 2.41 KB
/
docker-compose.yml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
version: "3.7"
services:
dphe-stream:
build:
context: ./dphe-stream
# Build the image with name and tag
image: dphe-stream:0.4.0-cr
hostname: dphe-stream
container_name: dphe-stream
init: true
restart: always
environment:
- HOST_GID=${HOST_GID:-1000}
- HOST_UID=${HOST_UID:-1000}
ports:
# Only for testing directly against the container
# dphe-stream container listens on port 8080 for the rest api
- "8181:8080"
volumes:
# Make log accessible on host
- "./dphe-stream/logs:/usr/src/app/v0.4.0-cr-release/dphe-stream-rest/logs"
networks:
- dphe-stream-network
dphe-stream-nginx:
build: ./dphe-stream-nginx
# Build the image with name and tag
image: dphe-stream-nginx:0.4.0-cr
hostname: dphe-stream-nginx
container_name: dphe-stream-nginx
init: true
restart: always
environment:
- HOST_GID=${HOST_GID:-1000}
- HOST_UID=${HOST_UID:-1000}
# Used by the entrypoint.sh script to check if the upstream service is ready
- UPSTREAM_ENDPOINT=http://dphe-stream:8080/application.wadl?detail=true
ports:
# Map host machine port 8080 to container port 8080 (since nginx runs as non-root)
- "8080:8080"
# Uncommnet the healthcheck section with desired configuration settings to determine if the state of the container is healthy
# This healthcheck triggers the python tests based on the options: interval, timeout and start_period
# healthcheck:
# test: ["CMD", "python3", "/usr/src/app/integration-test/test.py"]
# interval: 5m30s
# timeout: 30s
# retries: 3
# start_period: 30s
volumes:
# Make log accessible on host
- "./dphe-stream-nginx/logs:/usr/src/app/logs"
# Mount nginx configuration file from host to container
- "./dphe-stream-nginx/dphe-stream.conf:/etc/nginx/conf.d/dphe-stream.conf"
# Mount the integration test
- "./dphe-stream-nginx/integration-test:/usr/src/app/integration-test"
# Nginx reverse proxy forwarding requires the upstream service to be running and ready to accept requests
# Otherweise we'll get 502 error
# This 'depends_on' will run the containers in sequence, but it has no way of knowing
# when the upstream service is actually ready to receive requests
depends_on:
- dphe-stream
networks:
- dphe-stream-network
networks:
dphe-stream-network: