-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
175 lines (166 loc) · 4.82 KB
/
Copy pathdocker-compose.yml
File metadata and controls
175 lines (166 loc) · 4.82 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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
services:
api:
image: ghcr.io/marcoshack/taskwondo/api:${IMAGE_TAG:-latest}
build:
context: ./api
dockerfile: ../docker/Dockerfile.api
args:
- GOPROXY
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
nats:
condition: service_healthy
env_file: .env
environment:
# Always listen on port 8080 inside the container
- API_PORT=8080
# Always connect to postgres on port :5432 as it connectes directly through docker network, not the mapped port
- DATABASE_URL=postgres://${POSTGRES_USER:?required}:${POSTGRES_PASSWORD:?required}@postgres:5432/${POSTGRES_DB:-taskwondo}?sslmode=disable
- JWT_SECRET=${JWT_SECRET:?required — generate a random string of at least 32 chars}
- STORAGE_ENDPOINT=minio:9000
- STORAGE_ACCESS_KEY=${MINIO_ROOT_USER:?required}
- STORAGE_SECRET_KEY=${MINIO_ROOT_PASSWORD:?required}
- STORAGE_BUCKET=${MINIO_BUCKET:-taskwondo-attachments}
- NATS_URL=nats://nats:4222
- OLLAMA_URL=http://ollama:11434
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M
web:
image: ghcr.io/marcoshack/taskwondo/web:${IMAGE_TAG:-latest}
build:
context: .
dockerfile: docker/Dockerfile.web
ports:
- "${WEB_PORT:-3000}:80"
depends_on:
- api
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M
postgres:
image: pgvector/pgvector:pg16
volumes:
- pgdata:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRES_USER:?required}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?required}
POSTGRES_DB: ${POSTGRES_DB:-taskwondo}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:?required}"]
interval: 5s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M
worker:
image: ghcr.io/marcoshack/taskwondo/worker:${IMAGE_TAG:-latest}
build:
context: ./api
dockerfile: ../docker/Dockerfile.worker
args:
- GOPROXY
depends_on:
postgres:
condition: service_healthy
nats:
condition: service_healthy
env_file: .env
environment:
- DATABASE_URL=postgres://${POSTGRES_USER:?required}:${POSTGRES_PASSWORD:?required}@postgres:5432/${POSTGRES_DB:-taskwondo}?sslmode=disable
- JWT_SECRET=${JWT_SECRET:?required — generate a random string of at least 32 chars}
- STORAGE_ENDPOINT=minio:9000
- STORAGE_ACCESS_KEY=${MINIO_ROOT_USER:?required}
- STORAGE_SECRET_KEY=${MINIO_ROOT_PASSWORD:?required}
- STORAGE_BUCKET=${MINIO_BUCKET:-taskwondo-attachments}
- NATS_URL=nats://nats:4222
- OLLAMA_URL=http://ollama:11434
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
volumes:
- miniodata:/data
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:?required}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:?required}
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M
minio-init:
image: minio/mc:latest
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set local http://minio:9000 $${MINIO_ROOT_USER} $${MINIO_ROOT_PASSWORD};
mc mb --ignore-existing local/$${MINIO_BUCKET:-taskwondo-attachments};
exit 0;
"
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:?required}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:?required}
MINIO_BUCKET: ${MINIO_BUCKET:-taskwondo-attachments}
nats:
image: nats:2-alpine
command: ["--jetstream", "--store_dir=/data", "--http_port=8222"]
volumes:
- natsdata:/data
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8222/healthz"]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
deploy:
resources:
limits:
memory: 512M
ollama:
image: ollama/ollama:latest
profiles: ["semantic-search"]
volumes:
- ollama_data:/root/.ollama
deploy:
resources:
limits:
memory: 2G
restart: unless-stopped
# Pull the embedding model on first startup
ollama-init:
image: ollama/ollama:latest
profiles: ["semantic-search"]
depends_on:
- ollama
restart: "no"
entrypoint: ["ollama", "pull", "nomic-embed-text"]
environment:
OLLAMA_HOST: http://ollama:11434
volumes:
pgdata:
miniodata:
natsdata:
ollama_data: