daniel-was-taken commited on
Commit
84379c8
·
1 Parent(s): d0af789

Refactor Dockerfile and compose.yml to uncomment entrypoint and CMD, and update environment variables for app service

Browse files
Files changed (3) hide show
  1. Dockerfile +4 -4
  2. app.py +1 -1
  3. compose.yml +64 -62
Dockerfile CHANGED
@@ -29,15 +29,15 @@ RUN chmod +x entrypoint.sh
29
  EXPOSE 8000
30
 
31
  # Run the entrypoint script when the container launches
32
- # ENTRYPOINT ["./entrypoint.sh"]
33
 
34
  # Make port 8000 available to the world outside this container
35
  # EXPOSE 8000
36
 
37
  # Define environment variable
38
- ENV CHAINLIT_HOST=0.0.0.0
39
- ENV CHAINLIT_PORT=8000
40
 
41
  # Run app.py when the container launches
42
  # CMD ["chainlit", "run", "app.py"]
43
- CMD ["sh", "-c", "chainlit run app.py --host 0.0.0.0 --port ${PORT:-8000} --headless"]
 
29
  EXPOSE 8000
30
 
31
  # Run the entrypoint script when the container launches
32
+ ENTRYPOINT ["./entrypoint.sh"]
33
 
34
  # Make port 8000 available to the world outside this container
35
  # EXPOSE 8000
36
 
37
  # Define environment variable
38
+ # ENV CHAINLIT_HOST=0.0.0.0
39
+ # ENV CHAINLIT_PORT=8000
40
 
41
  # Run app.py when the container launches
42
  # CMD ["chainlit", "run", "app.py"]
43
+ # CMD chainlit run app.py --host 0.0.0.0 --port ${PORT:-8000} --headless
app.py CHANGED
@@ -32,7 +32,7 @@ from chainlit.input_widget import Select, Switch, Slider
32
  from langchain_core.documents import Document
33
  from typing_extensions import List
34
 
35
- from populate_db import main
36
 
37
  # Initialize Milvus client and embedding model
38
  MILVUS_URI = os.getenv("MILVUS_URI", "http://localhost:19530")
 
32
  from langchain_core.documents import Document
33
  from typing_extensions import List
34
 
35
+ # from populate_db import main
36
 
37
  # Initialize Milvus client and embedding model
38
  MILVUS_URI = os.getenv("MILVUS_URI", "http://localhost:19530")
compose.yml CHANGED
@@ -1,67 +1,67 @@
1
  version: '3.5'
2
 
3
  services:
4
- etcd:
5
- container_name: milvus-etcd
6
- image: quay.io/coreos/etcd:v3.5.18
7
- environment:
8
- - ETCD_AUTO_COMPACTION_MODE=revision
9
- - ETCD_AUTO_COMPACTION_RETENTION=1000
10
- - ETCD_QUOTA_BACKEND_BYTES=4294967296
11
- - ETCD_SNAPSHOT_COUNT=50000
12
- volumes:
13
- - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/etcd:/etcd
14
- command: etcd -advertise-client-urls=http://etcd:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
15
- healthcheck:
16
- test: ["CMD", "etcdctl", "endpoint", "health"]
17
- interval: 30s
18
- timeout: 20s
19
- retries: 3
20
 
21
- minio:
22
- container_name: milvus-minio
23
- image: minio/minio:RELEASE.2024-05-28T17-19-04Z
24
- environment:
25
- MINIO_ACCESS_KEY: minioadmin
26
- MINIO_SECRET_KEY: minioadmin
27
- ports:
28
- - "9001:9001"
29
- - "9000:9000"
30
- volumes:
31
- - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/minio:/minio_data
32
- command: minio server /minio_data --console-address ":9001"
33
- healthcheck:
34
- test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
35
- interval: 30s
36
- timeout: 20s
37
- retries: 3
38
 
39
- standalone:
40
- container_name: milvus-standalone
41
- image: milvusdb/milvus:v2.5.14
42
- command: ["milvus", "run", "standalone"]
43
- security_opt:
44
- - seccomp:unconfined
45
- environment:
46
- MINIO_REGION: us-east-1
47
- ETCD_ENDPOINTS: etcd:2379
48
- MINIO_ADDRESS: minio:9000
49
- volumes:
50
- - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/milvus:/var/lib/milvus
51
- healthcheck:
52
- test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
53
- interval: 30s
54
- start_period: 90s
55
- timeout: 20s
56
- retries: 3
57
- ports:
58
- - "19530:19530"
59
- - "9091:9091"
60
- depends_on:
61
- etcd:
62
- condition: service_healthy
63
- minio:
64
- condition: service_healthy
65
 
66
  app:
67
  container_name: rag-app
@@ -72,21 +72,23 @@ services:
72
  ports:
73
  - "8000:8000"
74
  environment:
75
- - MILVUS_URI=http://standalone:19530
 
76
  - OPENAI_API_KEY=${OPENAI_API_KEY}
77
  - NEBIUS_API_KEY=${NEBIUS_API_KEY}
78
  - PASSWORD=${PASSWORD}
79
  - CHAINLIT_AUTH_SECRET=${CHAINLIT_AUTH_SECRET}
80
  - OAUTH_GOOGLE_CLIENT_ID=${OAUTH_GOOGLE_CLIENT_ID}
81
  - OAUTH_GOOGLE_CLIENT_SECRET=${OAUTH_GOOGLE_CLIENT_SECRET}
 
82
 
83
  # Memory constraints for 4GB DigitalOcean droplet
84
  # Allocate 1.5GB to app, leaving room for Milvus and system
85
  mem_limit: 1536m
86
  memswap_limit: 1536m
87
 
88
- depends_on:
89
- - standalone
90
 
91
  networks:
92
  default:
 
1
  version: '3.5'
2
 
3
  services:
4
+ # etcd:
5
+ # container_name: milvus-etcd
6
+ # image: quay.io/coreos/etcd:v3.5.18
7
+ # environment:
8
+ # - ETCD_AUTO_COMPACTION_MODE=revision
9
+ # - ETCD_AUTO_COMPACTION_RETENTION=1000
10
+ # - ETCD_QUOTA_BACKEND_BYTES=4294967296
11
+ # - ETCD_SNAPSHOT_COUNT=50000
12
+ # volumes:
13
+ # - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/etcd:/etcd
14
+ # command: etcd -advertise-client-urls=http://etcd:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
15
+ # healthcheck:
16
+ # test: ["CMD", "etcdctl", "endpoint", "health"]
17
+ # interval: 30s
18
+ # timeout: 20s
19
+ # retries: 3
20
 
21
+ # minio:
22
+ # container_name: milvus-minio
23
+ # image: minio/minio:RELEASE.2024-05-28T17-19-04Z
24
+ # environment:
25
+ # MINIO_ACCESS_KEY: minioadmin
26
+ # MINIO_SECRET_KEY: minioadmin
27
+ # ports:
28
+ # - "9001:9001"
29
+ # - "9000:9000"
30
+ # volumes:
31
+ # - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/minio:/minio_data
32
+ # command: minio server /minio_data --console-address ":9001"
33
+ # healthcheck:
34
+ # test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
35
+ # interval: 30s
36
+ # timeout: 20s
37
+ # retries: 3
38
 
39
+ # standalone:
40
+ # container_name: milvus-standalone
41
+ # image: milvusdb/milvus:v2.5.14
42
+ # command: ["milvus", "run", "standalone"]
43
+ # security_opt:
44
+ # - seccomp:unconfined
45
+ # environment:
46
+ # MINIO_REGION: us-east-1
47
+ # ETCD_ENDPOINTS: etcd:2379
48
+ # MINIO_ADDRESS: minio:9000
49
+ # volumes:
50
+ # - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/milvus:/var/lib/milvus
51
+ # healthcheck:
52
+ # test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
53
+ # interval: 30s
54
+ # start_period: 90s
55
+ # timeout: 20s
56
+ # retries: 3
57
+ # ports:
58
+ # - "19530:19530"
59
+ # - "9091:9091"
60
+ # depends_on:
61
+ # etcd:
62
+ # condition: service_healthy
63
+ # minio:
64
+ # condition: service_healthy
65
 
66
  app:
67
  container_name: rag-app
 
72
  ports:
73
  - "8000:8000"
74
  environment:
75
+ - MILVUS_URI=${MILVUS_URI}
76
+ - MILVUS_API_KEY=${MILVUS_API_KEY}
77
  - OPENAI_API_KEY=${OPENAI_API_KEY}
78
  - NEBIUS_API_KEY=${NEBIUS_API_KEY}
79
  - PASSWORD=${PASSWORD}
80
  - CHAINLIT_AUTH_SECRET=${CHAINLIT_AUTH_SECRET}
81
  - OAUTH_GOOGLE_CLIENT_ID=${OAUTH_GOOGLE_CLIENT_ID}
82
  - OAUTH_GOOGLE_CLIENT_SECRET=${OAUTH_GOOGLE_CLIENT_SECRET}
83
+ - DATABASE_URL=${DATABASE_URL}
84
 
85
  # Memory constraints for 4GB DigitalOcean droplet
86
  # Allocate 1.5GB to app, leaving room for Milvus and system
87
  mem_limit: 1536m
88
  memswap_limit: 1536m
89
 
90
+ # depends_on:
91
+ # - standalone
92
 
93
  networks:
94
  default: