Skip to content

Commit

Permalink
Prepare image build (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
karelhala authored Nov 20, 2024
1 parent 8e7010a commit 7ecfebd
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 6 deletions.
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM registry.access.redhat.com/ubi9/nodejs-20 AS builder

USER root

WORKDIR /usr/share/builder

COPY package.json package-lock.json tsconfig.json config-overrides.js ./
COPY src ./src
COPY public ./public
COPY packages/common ./packages/common

RUN npm i

FROM registry.access.redhat.com/ubi9/nginx-124

WORKDIR /usr/share/nginx

COPY --from=builder /usr/share/builder/ /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf

EXPOSE 8080

CMD ["nginx", "-g", "daemon off;", "-c", "/etc/nginx/nginx.conf"]
21 changes: 21 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
events {}
http {
include mime.types;
error_log /dev/stdout info;
include /etc/nginx/sites-enabled/*;
server {
access_log /dev/stdout;
listen 8080;

location ~ \.css {
# add_header Content-Type text/css;
}

# nested routes
rewrite ^/api-catalog/api/(.*)$ /api/$1.html last;
# other assets like JS and CSS
rewrite ^/api-catalog(.+)$ $1 last;
# index route
rewrite ^/api-catalog$ / last;
}
}
121 changes: 115 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"assert-never": "^1.2.1",
"better-ajv-errors": "^1.2.0",
"customize-cra": "^1.0.0",
"eslint-plugin-prettier": "^5.2.1",
"gh-pages": "^5.0.0",
"glob": "^9.2.1",
"monaco-editor-webpack-plugin": "^7.0.1",
Expand Down
11 changes: 11 additions & 0 deletions packages/common/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions packages/discovery/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7ecfebd

Please sign in to comment.