-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
88 lines (83 loc) · 2.19 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
services:
db:
image: pgvector/pgvector:0.7.4-pg16
volumes:
- postgres_data:/var/lib/postgresql/data
- ./postgres:/docker-entrypoint-initdb.d
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
networks:
- api_network
container_name: postgres-db
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}" ]
interval: 10s
timeout: 5s
retries: 5
spring_service:
build:
context: ./web-api
dockerfile: Dockerfile
image: spring_service:latest
depends_on:
- db
# env_file:
# - .env
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/${POSTGRES_DB}
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER}
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD}
JAVA_MAIL_HOST: ${JAVA_MAIL_HOST}
JAVA_MAIL_PORT: ${JAVA_MAIL_PORT}
JAVA_MAIL_USERNAME: ${JAVA_MAIL_USERNAME}
JAVA_MAIL_PASSWORD: ${JAVA_MAIL_PASSWORD}
FLASK_ENDPOINT_URL: ${FLASK_ENDPOINT_URL}
OLLAMA_BASE_URL: ${OLLAMA_BASE_URL}
networks:
- api_network
ports:
- "8080:8080"
container_name: spring-service
command: bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; java -jar /app/amazon-insight-app.jar'
scraper_service:
build:
context: ./scraper-service
image: scraper_service:latest
depends_on:
- db
environment:
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
FLASK_APP: ${FLASK_APP}
FLASK_DEBUG: ${FLASK_DEBUG}
networks:
- api_network
ports:
- "5000:5000"
container_name: scraper-service
ollama:
image: ollama/ollama:latest
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [ gpu ]
ports:
- "11434:11434"
volumes:
- ./ollama_models:/root/.ollama
networks:
- api_network
container_name: ollama
environment:
OLLAMA_KEEP_ALIVE: -1
networks:
api_network:
volumes:
postgres_data:
ollama_models: