Skip to content

Commit 1f8812f

Browse files
Roland SchillingRoland Schilling
authored andcommitted
Using default nginx image for amd64 availability
* Adapted nginx configuration for rootless operation
1 parent 676aac7 commit 1f8812f

3 files changed

Lines changed: 32 additions & 8 deletions

File tree

Dockerfile

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ RUN npm run build
99

1010
FROM wurstbrot/dsomm-yaml-generation as yaml
1111

12-
FROM bitnami/nginx:latest
13-
COPY --from=yaml /var/www/html/src/assets/YAML/generated/generated.yaml /app/src/assets/YAML/generated/generated.yaml
14-
COPY nginx/location.conf /opt/bitnami/nginx/conf/bitnami/location.conf
15-
COPY --from=build /usr/src/app/dist/dsomm/ /app
12+
FROM nginx:alpine
13+
14+
RUN chown -R nginx:nginx /var/cache/nginx \
15+
&& chown -R nginx:nginx /var/log/nginx \
16+
&& touch /var/run/nginx.pid \
17+
&& chown -R nginx:nginx /var/run/nginx.pid
18+
19+
COPY --from=yaml ["/var/www/html/src/assets/YAML/generated/generated.yaml", "/usr/share/nginx/html/assets/YAML/generated/generated.yaml"]
20+
COPY ["nginx/default.conf", "/etc/nginx/conf.d/"]
21+
COPY --from=build ["/usr/src/app/dist/dsomm/", "/usr/share/nginx/html/"]
22+
23+
USER nginx

nginx/default.conf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
server {
2+
listen 8080;
3+
server_name localhost;
4+
5+
#access_log /var/log/nginx/host.access.log main;
6+
7+
location / {
8+
root /usr/share/nginx/html;
9+
try_files $uri $uri/ /index.html =404;
10+
}
11+
12+
#error_page 404 /404.html;
13+
14+
# redirect server error pages to the static page /50x.html
15+
#
16+
error_page 500 502 503 504 /50x.html;
17+
location = /50x.html {
18+
root /usr/share/nginx/html;
19+
}
20+
}

nginx/location.conf

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)