Skip to content

Commit 6cefdea

Browse files
Change nginx image source (#44)
* Change nginx image source Change the image source to avoid hitting the Docker Hub pull rate limit. * build: dockerfile nginx execution cmd * build: nginx conf target directory * build: nginx configuration for ubi image --------- Co-authored-by: Tero Virtanen <tero.tapio.virtanen@gmail.com>
1 parent 0955ccf commit 6cefdea

2 files changed

Lines changed: 21 additions & 23 deletions

File tree

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ COPY --chown=root:root . .
3737
RUN npm install -D webpack-cli && npm run dist
3838

3939
# =======================================================
40-
FROM nginx:1.26.1-alpine AS production
40+
FROM registry.access.redhat.com/ubi9/nginx-122 AS production
4141
# =======================================================
4242
# Add application sources to a directory that the assemble script expects them
4343
# and set permissions so that the container runs without root access
@@ -48,8 +48,11 @@ RUN chgrp -R 0 /usr/share/nginx/html && \
4848

4949
COPY --from=staticbuilder /app/dist /usr/share/nginx/html
5050

51-
USER 1001
51+
COPY nginx.conf /opt/app-root/etc/nginx.default.d/default.conf
5252

53-
COPY nginx.conf /etc/nginx/conf.d/default.conf
53+
USER 1001
5454

5555
EXPOSE 8080
56+
57+
# Run script uses standard ways to run the application
58+
CMD ["/bin/bash", "-c", "nginx -g \"daemon off;\""]

nginx.conf

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
1-
server {
2-
listen 8080;
3-
server_name localhost;
1+
location /healthz {
2+
return 200;
43

5-
location /healthz {
6-
return 200;
7-
8-
access_log off;
9-
}
4+
access_log off;
5+
}
106

11-
location /readiness {
12-
return 200;
7+
location /readiness {
8+
return 200;
139

14-
access_log off;
15-
}
10+
access_log off;
11+
}
1612

17-
location / {
18-
root /usr/share/nginx/html;
19-
try_files $uri /index.html;
20-
}
13+
location / {
14+
root /usr/share/nginx/html;
15+
try_files $uri /index.html;
16+
}
2117

22-
error_page 500 502 503 504 /50x.html;
23-
location = /50x.html {
24-
root /usr/share/nginx/html;
25-
}
18+
error_page 500 502 503 504 /50x.html;
19+
location = /50x.html {
20+
root /usr/share/nginx/html;
2621
}

0 commit comments

Comments
 (0)