From bb06fa64fa711ad26c12ceae5eebcfb22bb79035 Mon Sep 17 00:00:00 2001 From: WenjiaoYue Date: Thu, 23 May 2024 15:52:45 +0800 Subject: [PATCH] update front_end docker (#176) Signed-off-by: Yue, Wenjiao --- AudioQnA/ui/docker/Dockerfile | 23 +++++++++++++++++++++++ ChatQnA/ui/docker/Dockerfile | 13 ++++++++----- CodeGen/ui/docker/Dockerfile | 13 ++++++++----- CodeTrans/ui/docker/Dockerfile | 13 ++++++++----- DocSum/ui/docker/Dockerfile | 13 ++++++++----- SearchQnA/ui/docker/Dockerfile | 23 +++++++++++++++++++++++ Translation/ui/docker/Dockerfile | 23 +++++++++++++++++++++++ 7 files changed, 101 insertions(+), 20 deletions(-) create mode 100644 AudioQnA/ui/docker/Dockerfile create mode 100644 SearchQnA/ui/docker/Dockerfile create mode 100644 Translation/ui/docker/Dockerfile diff --git a/AudioQnA/ui/docker/Dockerfile b/AudioQnA/ui/docker/Dockerfile new file mode 100644 index 000000000..c13ada043 --- /dev/null +++ b/AudioQnA/ui/docker/Dockerfile @@ -0,0 +1,23 @@ +# Use node 20.11.1 as the base image +FROM node:20.11.1 + +# Update package manager and install Git +RUN apt-get update -y && apt-get install -y git + +# Copy the front-end code repository +COPY ../svelte /home/user/svelte + +# Set the working directory +WORKDIR /home/user/svelte + +# Install front-end dependencies +RUN npm install + +# Build the front-end application +RUN npm run build + +# Expose the port of the front-end application +EXPOSE 5173 + +# Run the front-end application in preview mode +CMD ["npm", "run", "preview", "--", "--port", "5173", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/ChatQnA/ui/docker/Dockerfile b/ChatQnA/ui/docker/Dockerfile index 0051a4d71..c13ada043 100644 --- a/ChatQnA/ui/docker/Dockerfile +++ b/ChatQnA/ui/docker/Dockerfile @@ -4,17 +4,20 @@ FROM node:20.11.1 # Update package manager and install Git RUN apt-get update -y && apt-get install -y git -# Clone the front-end code repository -RUN git clone https://github.com/opea-project/GenAIExamples.git /home/user/GenAIExamples +# Copy the front-end code repository +COPY ../svelte /home/user/svelte # Set the working directory -WORKDIR /home/user/GenAIExamples/ChatQnA/ui/svelte +WORKDIR /home/user/svelte # Install front-end dependencies RUN npm install +# Build the front-end application +RUN npm run build + # Expose the port of the front-end application EXPOSE 5173 -# Run the front-end application -CMD ["npm", "run", "dev", "--", "--host=0.0.0.0"] +# Run the front-end application in preview mode +CMD ["npm", "run", "preview", "--", "--port", "5173", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/CodeGen/ui/docker/Dockerfile b/CodeGen/ui/docker/Dockerfile index 2a9b7deed..c13ada043 100644 --- a/CodeGen/ui/docker/Dockerfile +++ b/CodeGen/ui/docker/Dockerfile @@ -4,17 +4,20 @@ FROM node:20.11.1 # Update package manager and install Git RUN apt-get update -y && apt-get install -y git -# Clone the front-end code repository -RUN git clone https://github.com/opea-project/GenAIExamples.git /home/user/GenAIExamples +# Copy the front-end code repository +COPY ../svelte /home/user/svelte # Set the working directory -WORKDIR /home/user/GenAIExamples/CodeGen/ui/svelte +WORKDIR /home/user/svelte # Install front-end dependencies RUN npm install +# Build the front-end application +RUN npm run build + # Expose the port of the front-end application EXPOSE 5173 -# Run the front-end application -CMD ["npm", "run", "dev", "--", "--host=0.0.0.0"] +# Run the front-end application in preview mode +CMD ["npm", "run", "preview", "--", "--port", "5173", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/CodeTrans/ui/docker/Dockerfile b/CodeTrans/ui/docker/Dockerfile index 71fd5ea4f..c13ada043 100644 --- a/CodeTrans/ui/docker/Dockerfile +++ b/CodeTrans/ui/docker/Dockerfile @@ -4,17 +4,20 @@ FROM node:20.11.1 # Update package manager and install Git RUN apt-get update -y && apt-get install -y git -# Clone the front-end code repository -RUN git clone https://github.com/opea-project/GenAIExamples.git /home/user/GenAIExamples +# Copy the front-end code repository +COPY ../svelte /home/user/svelte # Set the working directory -WORKDIR /home/user/GenAIExamples/CodeTrans/ui/svelte +WORKDIR /home/user/svelte # Install front-end dependencies RUN npm install +# Build the front-end application +RUN npm run build + # Expose the port of the front-end application EXPOSE 5173 -# Run the front-end application -CMD ["npm", "run", "dev", "--", "--host=0.0.0.0"] +# Run the front-end application in preview mode +CMD ["npm", "run", "preview", "--", "--port", "5173", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/DocSum/ui/docker/Dockerfile b/DocSum/ui/docker/Dockerfile index c4785f69a..c13ada043 100644 --- a/DocSum/ui/docker/Dockerfile +++ b/DocSum/ui/docker/Dockerfile @@ -4,17 +4,20 @@ FROM node:20.11.1 # Update package manager and install Git RUN apt-get update -y && apt-get install -y git -# Clone the front-end code repository -RUN git clone https://github.com/opea-project/GenAIExamples.git /home/user/GenAIExamples +# Copy the front-end code repository +COPY ../svelte /home/user/svelte # Set the working directory -WORKDIR /home/user/GenAIExamples/DocSum/ui/svelte +WORKDIR /home/user/svelte # Install front-end dependencies RUN npm install +# Build the front-end application +RUN npm run build + # Expose the port of the front-end application EXPOSE 5173 -# Run the front-end application -CMD ["npm", "run", "dev", "--", "--host=0.0.0.0"] +# Run the front-end application in preview mode +CMD ["npm", "run", "preview", "--", "--port", "5173", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/SearchQnA/ui/docker/Dockerfile b/SearchQnA/ui/docker/Dockerfile new file mode 100644 index 000000000..c13ada043 --- /dev/null +++ b/SearchQnA/ui/docker/Dockerfile @@ -0,0 +1,23 @@ +# Use node 20.11.1 as the base image +FROM node:20.11.1 + +# Update package manager and install Git +RUN apt-get update -y && apt-get install -y git + +# Copy the front-end code repository +COPY ../svelte /home/user/svelte + +# Set the working directory +WORKDIR /home/user/svelte + +# Install front-end dependencies +RUN npm install + +# Build the front-end application +RUN npm run build + +# Expose the port of the front-end application +EXPOSE 5173 + +# Run the front-end application in preview mode +CMD ["npm", "run", "preview", "--", "--port", "5173", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/Translation/ui/docker/Dockerfile b/Translation/ui/docker/Dockerfile new file mode 100644 index 000000000..c13ada043 --- /dev/null +++ b/Translation/ui/docker/Dockerfile @@ -0,0 +1,23 @@ +# Use node 20.11.1 as the base image +FROM node:20.11.1 + +# Update package manager and install Git +RUN apt-get update -y && apt-get install -y git + +# Copy the front-end code repository +COPY ../svelte /home/user/svelte + +# Set the working directory +WORKDIR /home/user/svelte + +# Install front-end dependencies +RUN npm install + +# Build the front-end application +RUN npm run build + +# Expose the port of the front-end application +EXPOSE 5173 + +# Run the front-end application in preview mode +CMD ["npm", "run", "preview", "--", "--port", "5173", "--host", "0.0.0.0"] \ No newline at end of file