File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1616# under the License.
1717
1818# Build stage
19- FROM node:22.12.0-alpine AS builder
19+ FROM registry.access.redhat.com/ubi9/nodejs-22-minimal:9.7-1767673763 AS builder
2020
2121# Default environment variables (can be overridden at runtime)
2222ENV VITE_POLARIS_API_URL=http://polaris:8181
@@ -39,22 +39,21 @@ COPY . .
3939RUN npm run build
4040
4141# Production stage
42- FROM nginx:alpine
42+ FROM registry.access.redhat.com/ubi9/ nginx-126:9.7-1767846422
4343
4444# Copy DISCLAIMER, LICENSE, NOTICE files
4545COPY DISCLAIMER /DISCLAIMER
4646COPY LICENSE-BUNDLE /LICENSE
4747COPY NOTICE /NOTICE
4848
4949# Copy custom nginx configuration as template
50- COPY docker/nginx.conf /etc/nginx/conf .d/default.conf.template
50+ COPY docker/nginx.conf /opt/app-root/ etc/nginx.d/default.conf.template
5151
5252# Copy runtime config generation script
53- COPY docker/generate-config.sh /generate-config.sh
54- RUN chmod +x /generate-config.sh
53+ COPY --chmod=755 docker/generate-config.sh /generate-config.sh
5554
5655# Copy built application from builder stage
57- COPY --from=builder /app/dist /usr/share/nginx/html
56+ COPY --from=builder /app/dist /opt/app-root/src
5857
5958# Expose port 80
6059EXPOSE 80
Original file line number Diff line number Diff line change 1717# under the License.
1818
1919# Generate nginx configuration with the backend URL
20- envsubst ' ${VITE_POLARIS_API_URL}' < /etc/nginx/conf .d/default.conf.template > /etc/nginx/conf .d/default.conf
20+ envsubst ' ${VITE_POLARIS_API_URL}' < /opt/app-root/ etc/nginx.d/default.conf.template > /opt/app-root/ etc/nginx.d/default.conf
2121
2222echo " Generated nginx config with backend: ${VITE_POLARIS_API_URL} "
2323
2424# Generate runtime configuration from environment variables
25- cat > /usr/share/nginx/html /config.js << EOF
25+ cat > /opt/app-root/src /config.js << EOF
2626// Runtime configuration generated from environment variables
2727window.APP_CONFIG = {
2828 VITE_POLARIS_API_URL: '${VITE_POLARIS_API_URL} ',
@@ -33,7 +33,7 @@ window.APP_CONFIG = {
3333EOF
3434
3535echo " Generated config.js with runtime configuration:"
36- cat /usr/share/nginx/html /config.js
36+ cat /opt/app-root/src /config.js
3737
3838# Start nginx
3939exec nginx -g ' daemon off;'
Original file line number Diff line number Diff line change 1818server {
1919 listen 80 ;
2020 server_name localhost;
21- root /usr/share/nginx/html ;
21+ root /opt/app- root /src ;
2222 index index .html;
2323
2424 # Gzip compression
You can’t perform that action at this time.
0 commit comments