From f30c74c18f9696329b2e67446b901117db6c5122 Mon Sep 17 00:00:00 2001 From: lexluo09 <39718951+lexluo09@users.noreply.github.com> Date: Wed, 17 Jul 2024 23:19:28 +0800 Subject: [PATCH] (improvement)(docker) Supports three types of mount methods: Named Volumes, Bind Mounts, and Detailed Bind Mounts. (#1420) --- docker/Dockerfile | 5 +++++ docker/docker-compose.yml | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 3530d4e55..16c181dd0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -12,6 +12,11 @@ RUN apt-get update && \ apt-get install -y default-mysql-client unzip && \ rm -rf /var/lib/apt/lists/* +# Install the vim editor. +RUN apt-get update && \ + apt-get install -y vim && \ + rm -rf /var/lib/apt/lists/* + # Copy the supersonic standalone zip file into the container COPY assembly/build/supersonic-standalone-${SUPERSONIC_VERSION}.zip . diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 7b168da72..0d6b22c1f 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -101,10 +101,22 @@ services: - 114.114.114.114 - 8.8.8.8 - 8.8.4.4 - + volumes: + #1.Named Volumes are best for persistent data managed by Docker. + - supersonic_data:/usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest} + #2.Bind Mounts are suitable for frequent modifications and debugging. + # - ./conf/langchain4j-prd.yaml:/usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/conf/langchain4j-prd.yaml + #3.Detailed Bind Mounts offer more control over the mount behavior. + # - type: bind + # source: ./supersonic-standalone-${SUPERSONIC_VERSION:-latest}/logs + # target: /usr/src/app/supersonic-standalone-${SUPERSONIC_VERSION:-latest}/logs + # bind: + # propagation: rprivate + # create_host_path: true volumes: mysql_data: chroma_data: + supersonic_data: networks: - supersonic_network: + supersonic_network: \ No newline at end of file