update front_end docker (#176)

Signed-off-by: Yue, Wenjiao <wenjiao.yue@intel.com>
This commit is contained in:
WenjiaoYue
2024-05-23 15:52:45 +08:00
committed by GitHub
parent 760397fd8f
commit bb06fa64fa
7 changed files with 101 additions and 20 deletions

View File

@@ -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"]