-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from bharathappali/add-manifests
Add manifests
- Loading branch information
Showing
16 changed files
with
403 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,27 @@ | ||
FROM node:16 AS builder | ||
|
||
WORKDIR /builder | ||
|
||
RUN npm config set legacy-peer-deps true | ||
|
||
COPY package.json ./ | ||
|
||
RUN npm install | ||
WORKDIR /app | ||
|
||
COPY . ./ | ||
|
||
COPY deploy.sh /deploy.sh | ||
|
||
RUN ./deploy.sh -c | ||
|
||
FROM registry.access.redhat.com/ubi8/nginx-118 | ||
RUN npm config set legacy-peer-deps true \ | ||
&& npm install \ | ||
&& KRUIZE_UI_ENV=production npm run build | ||
|
||
USER root | ||
FROM nginx:latest | ||
|
||
COPY --from=builder /builder/dist/* /usr/share/nginx/html | ||
RUN rm /etc/nginx/conf.d/default.conf \ | ||
&&mkdir -p /var/cache/nginx/client_temp /var/run/nginx \ | ||
&& chown -R nginx:nginx /var/cache/nginx /var/run/nginx \ | ||
&& touch /var/run/nginx.pid \ | ||
&& chown nginx:nginx /var/run/nginx.pid | ||
|
||
#RUN rm -rf /etc/nginx/conf.d/default.conf | ||
# Switch to the non-root user | ||
USER nginx | ||
|
||
#COPY ./nginx.conf /etc/nginx/conf.d | ||
|
||
#USER default | ||
COPY --from=builder /app/dist/* /usr/share/nginx/html/ | ||
|
||
EXPOSE 80 | ||
|
||
# WORKDIR /etc/nginx | ||
|
||
# RUN cp nginx.conf /tmp | ||
# RUN sed -i 's|listen \[::\]:8080 default_server|listen 8080|' /tmp/nginx.conf | ||
# RUN sed -i 's|listen 8080 default_server;||' /tmp/nginx.conf | ||
# RUN cat /tmp/nginx.conf >nginx.conf | ||
|
||
|
||
CMD ["nginx", "-g", "daemon off;"] | ||
|
||
#ENTRYPOINT ["nginx", "-g", "daemon off;"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: nginx-config | ||
namespace: monitoring | ||
data: | ||
nginx.conf: | | ||
events {} | ||
http { | ||
upstream kruize-api { | ||
server kruize:8080; | ||
} | ||
server { | ||
listen 8080; | ||
server_name localhost; | ||
root /usr/share/nginx/html; | ||
location ^~ /api/ { | ||
rewrite ^/api(.*)$ $1 break; | ||
proxy_pass http://kruize-api; | ||
} | ||
location / { | ||
index index.html; | ||
error_page 404 =200 /index.html; | ||
} | ||
} | ||
} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: kruize-ui-nginx-service | ||
namespace: monitoring | ||
spec: | ||
type: NodePort | ||
ports: | ||
- name: http | ||
port: 8080 | ||
targetPort: 8080 | ||
selector: | ||
app: kruize-ui-nginx | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: kruize-ui-nginx-pod | ||
namespace: monitoring | ||
labels: | ||
app: kruize-ui-nginx | ||
spec: | ||
containers: | ||
- name: kruize-ui-nginx-container | ||
image: quay.io/kruize/kruize-ui:0.0.1 | ||
imagePullPolicy: Always | ||
env: | ||
- name: KRUIZE_UI_ENV | ||
value: "production" | ||
volumeMounts: | ||
- name: nginx-config-volume | ||
mountPath: /etc/nginx/nginx.conf | ||
subPath: nginx.conf | ||
volumes: | ||
- name: nginx-config-volume | ||
configMap: | ||
name: nginx-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: nginx-config | ||
namespace: monitoring | ||
data: | ||
nginx.conf: | | ||
events {} | ||
http { | ||
upstream kruize-api { | ||
server kruize:8080; | ||
} | ||
server { | ||
listen 80; | ||
server_name localhost; | ||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
} | ||
location /api/ { | ||
rewrite ^/api(.*)$ $1 break; | ||
proxy_pass http://kruize-api; | ||
} | ||
} | ||
} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: kruize-ui-nginx-service | ||
namespace: monitoring | ||
spec: | ||
type: NodePort | ||
ports: | ||
- name: http | ||
port: 80 | ||
targetPort: 80 | ||
nodePort: 32323 | ||
selector: | ||
app: kruize-ui-nginx | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: kruize-ui-nginx-pod | ||
namespace: monitoring | ||
labels: | ||
app: kruize-ui-nginx | ||
spec: | ||
containers: | ||
- name: kruize-ui-nginx-container | ||
image: quay.io/kruize/kruize-ui:0.0.1 | ||
volumeMounts: | ||
- name: nginx-config-volume | ||
mountPath: /etc/nginx/nginx.conf | ||
subPath: nginx.conf | ||
volumes: | ||
- name: nginx-config-volume | ||
configMap: | ||
name: nginx-config |
Oops, something went wrong.