Skip to content

Commit bf1c15a

Browse files
authored
Merge pull request #4598 from ELK4N4/koku-ui-onprem/dockerfile
Add Dockerfile and nginx configuration for koku-ui-onprem
2 parents 7fa0fda + bea6ec5 commit bf1c15a

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

apps/koku-ui-onprem/Containerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM registry.redhat.io/ubi10/nodejs-22-minimal AS builder
2+
WORKDIR /app
3+
4+
USER 0
5+
6+
COPY package.json ./
7+
COPY package-lock.json ./
8+
COPY tsconfig.json ./
9+
COPY apps/koku-ui-onprem/package.json ./apps/koku-ui-onprem/
10+
COPY libs ./libs
11+
12+
RUN npm ci
13+
14+
COPY apps/koku-ui-onprem ./apps/koku-ui-onprem/
15+
RUN npm run build --workspace=@koku-ui/koku-ui-onprem
16+
17+
USER 1001
18+
19+
FROM registry.redhat.io/ubi10/nginx-126
20+
21+
COPY apps/koku-ui-onprem/nginx.conf.template /tmp/nginx.conf.template
22+
COPY --from=builder /app/apps/koku-ui-onprem/dist .
23+
24+
EXPOSE 8080
25+
CMD ["/bin/sh", "-c", "envsubst '\\$API_PROXY_URL' < /tmp/nginx.conf.template > ${NGINX_DEFAULT_CONF_PATH}/nginx.conf && exec nginx -g 'daemon off;'"]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
location /api {
2+
proxy_pass ${API_PROXY_URL};
3+
4+
proxy_set_header Authorization "Bearer $http_x_forwarded_access_token";
5+
proxy_set_header Host $host;
6+
proxy_set_header X-Real-IP $remote_addr;
7+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
8+
9+
proxy_http_version 1.1;
10+
proxy_set_header Connection "";
11+
}
12+
13+
location / {
14+
try_files $uri $uri/ /index.html;
15+
add_header X-Frame-Options "SAMEORIGIN";
16+
add_header X-Content-Type-Options "nosniff";
17+
add_header Referrer-Policy "strict-origin-when-cross-origin";
18+
}

0 commit comments

Comments
 (0)