jonathanjordan21 commited on
Commit
9b090ae
·
verified ·
1 Parent(s): eea80b7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -29
Dockerfile CHANGED
@@ -1,35 +1,27 @@
1
- # Use an official Ubuntu base image
2
- FROM ubuntu:20.04
3
 
4
- # Set environment variables
5
- ENV DEBIAN_FRONTEND=noninteractive
6
- ENV TZ=Asia/Jakarta
7
 
8
- # Install dependencies
9
- RUN apt-get update && \
10
- apt-get install -y \
11
- curl \
12
- ca-certificates \
13
- gnupg \
14
- lsb-release \
15
- sudo \
16
- apt-transport-https && \
17
- rm -rf /var/lib/apt/lists/*
18
 
19
- # Install Docker in the container (to use Docker CLI if needed)
20
- RUN apt-get update && \
21
- apt-get install -y docker.io
 
 
22
 
23
- # Copy the existing standalone_embed.sh script into the container
24
- COPY standalone_embed.sh /standalone_embed.sh
25
- RUN chmod +x /standalone_embed.sh
26
 
27
- # Set appropriate permissions for Milvus configuration files
28
- RUN touch embedEtcd.yaml user.yaml && \
29
- chmod 666 embedEtcd.yaml user.yaml
30
 
31
- # Expose the default Milvus port
32
- EXPOSE 19530
33
-
34
- # Start Milvus on container startup
35
- CMD ["bash", "-c", "/standalone_embed.sh start && tail -f /dev/null"]
 
1
+ # Start from the Milvus base image
2
+ FROM milvusdb/milvus:v2.4.15
3
 
4
+ # Create required directories and set permissions
5
+ RUN mkdir -p /var/lib/milvus /milvus/configs && \
6
+ chmod -R 777 /var/lib/milvus /milvus/configs
7
 
8
+ # Copy necessary configuration files
9
+ # Assumes embedEtcd.yaml and user.yaml are in the build context
10
+ COPY embedEtcd.yaml /milvus/configs/embedEtcd.yaml
11
+ COPY user.yaml /milvus/configs/user.yaml
 
 
 
 
 
 
12
 
13
+ # Environment variables required for Milvus standalone setup
14
+ ENV ETCD_USE_EMBED=true
15
+ ENV ETCD_DATA_DIR=/var/lib/milvus/etcd
16
+ ENV ETCD_CONFIG_PATH=/milvus/configs/embedEtcd.yaml
17
+ ENV COMMON_STORAGETYPE=local
18
 
19
+ # Expose necessary ports for Milvus
20
+ EXPOSE 19530 9091 2379
 
21
 
22
+ # Health check command to monitor Milvus status
23
+ HEALTHCHECK --interval=30s --timeout=20s --start-period=90s --retries=3 \
24
+ CMD curl -f http://localhost:9091/healthz || exit 1
25
 
26
+ # Command to start Milvus in standalone mode
27
+ CMD ["milvus", "run", "standalone"]