-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathdocker-compose-pro-local-build.yml
64 lines (61 loc) · 2.52 KB
/
docker-compose-pro-local-build.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
version: "3.8"
services:
meme_search_pro:
build:
context: ./meme_search_pro/meme_search_app
dockerfile: Dockerfile
container_name: meme_search_pro
environment: # <-- you can adjust these values in your .env file
DATABASE_URL: "postgres://postgres:postgres@meme-search-db:${DB_PORT:-5432}/meme_search"
APP_HOST: "${APP_HOST:-localhost}"
APP_PORT: "${APP_PORT:-3000}"
GEN_PORT: "${GEN_PORT:-8000}"
DOCKER_HOST_INTERNAL: "${DOCKER_HOST_INTERNAL:-host.docker.internal}"
ports:
- "${APP_PORT:-3000}:3000" # <-- adjust to desired local port for this service in your .env file
depends_on:
meme_search_db:
condition: service_healthy
volumes: # <-- any additional meme directory must be mounted here
- ./meme_search_pro/memes/:/rails/public/memes # <-- example meme directories
image_to_text_generator:
build:
context: ./meme_search_pro/image_to_text_generator
dockerfile: Dockerfile
container_name: image_to_text_generator
environment: # <-- you can adjust these values in your .env file
APP_HOST: "${APP_HOST:-localhost}"
APP_PORT: "${APP_PORT:-3000}"
GEN_PORT: "${GEN_PORT:-8000}"
DOCKER_HOST_INTERNAL: "${DOCKER_HOST_INTERNAL:-host.docker.internal}"
ports:
- "${GEN_PORT:-8000}:8000" # <-- adjust to desired local port for this service in your .env file)"
volumes: # <-- any additional meme directory must be mounted here
- ./meme_search_pro/memes/:/app/public/memes # <-- example meme directories
- ./meme_search_pro/db_data/image_to_text_generator:/app/db
- ./meme_search_pro/models:/root/.cache/huggingface
deploy:
resources:
limits: # <-- roughly tested min memory for cpu usage
memory: 12GB
# reservations: # <-- uncomment for gpu usage
# devices:
# - driver: nvidia
# count: 1
# capabilities: [gpu]
meme_search_db:
image: pgvector/pgvector:pg17
container_name: meme-search-db # note: must use - and not _ as ActiveRecord uses URI::RFC2396_Parser to parse database URLs
volumes:
- ./meme_search_pro/db_data/meme-search-db:/var/lib/postgresql/data
environment:
POSTGRES_DB: meme_search
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "${DB_PORT:-5432}:5432" # <-- adjust to desired local port for this service in your .env file
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5