Signed-off-by: Chingis Yundunov <YundunovCN@sibedge.com> Co-authored-by: Chingis Yundunov <YundunovCN@sibedge.com> Co-authored-by: Malini Bhandaru <malini.bhandaru@intel.com>
34 lines
670 B
Docker
34 lines
670 B
Docker
# Copyright (C) 2024 Intel Corporation
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# Stage 1: Build the React application using Node.js
|
|
# Use Node 20.11.1 as the base image for the build step
|
|
|
|
FROM node:20.11.1 AS vite-app
|
|
|
|
ARG texttosql_url
|
|
|
|
ENV TEXT_TO_SQL_URL=$texttosql_url
|
|
|
|
WORKDIR /usr/app/react
|
|
|
|
COPY react /usr/app/react
|
|
WORKDIR /usr/app/react
|
|
|
|
|
|
RUN ["npm", "install"]
|
|
RUN ["npm", "run", "build"]
|
|
|
|
FROM nginx:alpine
|
|
|
|
ARG texttosql_url
|
|
|
|
ENV TEXT_TO_SQL_URL=$texttosql_url
|
|
|
|
EXPOSE 80
|
|
|
|
COPY --from=vite-app /usr/app/react/dist /usr/share/nginx/html
|
|
COPY --from=vite-app /usr/app/react/nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|