diff --git a/micro-ui/web/packages/pgr/docker/Dockerfile b/micro-ui/web/packages/pgr/docker/Dockerfile new file mode 100644 index 00000000000..68eb71d9ab9 --- /dev/null +++ b/micro-ui/web/packages/pgr/docker/Dockerfile @@ -0,0 +1,30 @@ +# Use Node.js base image with version 16 +FROM node:16 AS build + +# Set working directory +WORKDIR /app + +# Copy package.json and yarn.lock (if exists) +COPY package.json ./ + +# clear cache +RUN yarn cache clean + +# Install dependencies +RUN yarn install + +# Copy the rest of the application +COPY . . + +# Build the React app with Webpack +RUN yarn build + +FROM nginx:mainline-alpine + +ENV WORK_DIR=/var/web/pgr-ui + +RUN mkdir -p ${WORK_DIR} + + +COPY --from=build /app/dist ${WORK_DIR}/ +COPY --from=build /app/docker/nginx.conf /etc/nginx/conf.d/default.conf diff --git a/micro-ui/web/packages/pgr/docker/nginx.conf b/micro-ui/web/packages/pgr/docker/nginx.conf new file mode 100644 index 00000000000..7b71731403f --- /dev/null +++ b/micro-ui/web/packages/pgr/docker/nginx.conf @@ -0,0 +1,12 @@ +server +{ + listen 80; + underscores_in_headers on; + + location /pgr-ui + { + root /var/web; + index index.html index.htm; + try_files $uri $uri/ /pgr-ui/index.html; + } +} \ No newline at end of file