Skip to content

Commit 34e63e6

Browse files
Console: Update docker image to redhat UBI images (#129)
* Update docker image to redhat ubi images * Added license * Updated as per review comments * remove global config
1 parent abc2cd2 commit 34e63e6

3 files changed

Lines changed: 9 additions & 10 deletions

File tree

console/docker/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
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)
2222
ENV VITE_POLARIS_API_URL=http://polaris:8181
@@ -39,22 +39,21 @@ COPY . .
3939
RUN 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
4545
COPY DISCLAIMER /DISCLAIMER
4646
COPY LICENSE-BUNDLE /LICENSE
4747
COPY 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
6059
EXPOSE 80

console/docker/generate-config.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
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

2222
echo "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
2727
window.APP_CONFIG = {
2828
VITE_POLARIS_API_URL: '${VITE_POLARIS_API_URL}',
@@ -33,7 +33,7 @@ window.APP_CONFIG = {
3333
EOF
3434

3535
echo "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
3939
exec nginx -g 'daemon off;'

console/docker/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
server {
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

0 commit comments

Comments
 (0)