-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
67 lines (65 loc) · 1.79 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
services:
db:
#image: postgres:16
image: pgvector/pgvector:pg16
container_name: reviews-postgres
ports:
- "5432:5432"
# Note:
# Postgres environment variables only respected when volume first created,
# after which the database and user are already created.
# Also, changing POSTGRES_USER doesn't change the container's linux system user, and complicates things.
# ref: https://github.com/docker-library/docs/tree/master/postgres#postgres_user
# ref: https://github.com/docker-library/docs/tree/master/postgres#arbitrary---user-notes
env_file:
- .env
# environment:
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: reviews
# POSTGRES_DB: reviews
volumes:
- reviews-postgres:/var/lib/postgresql/data
- ./data/export:/export
restart: always
healthcheck:
test: [ "CMD-SHELL", "sh -c 'pg_isready -h db -p 5432 -U ${POSTGRES_USER} -d ${POSTGRES_DB}'"]
interval: 10s
timeout: 3s
retries: 3
networks:
- net
graphqlapi:
depends_on:
db:
condition: service_healthy
modelapi:
condition: service_healthy
image: amazonreviews/graphql-api:latest
container_name: reviews-graphql-api
ports:
- "4000:8080"
env_file:
- .env
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/${POSTGRES_DB}
# SPRING_DATASOURCE_USERNAME: postgres
# SPRING_DATASOURCE_PASSWORD: reviews
MODEL_API_URL: http://modelapi:5000
networks:
- net
modelapi:
image: amazonreviews/model-api:latest
container_name: reviews-model-api
ports:
- "5000:5000"
networks:
- net
# deploy:
# resources:
# limits:
# memory: 512M
volumes:
reviews-postgres:
networks:
net:
driver: bridge