Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ COPY /frontend ./
RUN npm run build-prod
RUN npm run build:wc

FROM nginx:alpine
FROM nginxinc/nginx-unprivileged:alpine
USER 101


COPY --from=build /app/frontend/dist/ /usr/share/nginx/html/ui/example-content/ui/
COPY --from=build /app/frontend/dist-wc/ /usr/share/nginx/html/ui/example-content/wc/
COPY nginx.conf /etc/nginx/nginx.conf
COPY nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 8080
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"ng": "ng",
"start": "ng serve ui",
"start:wc": "ng serve wc --single-bundle --no-live-reload --port=4201",
"start:wc": "ng serve wc --single-bundle --no-live-reload --port=4201 --serve-path=/ui/example-ui/wc/ ",
"build": "ng build ui",
"build:wc": "ng build wc --single-bundle --output-hashing none",
"build-prod": "ng build ui -c production",
Expand Down
21 changes: 7 additions & 14 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
# the events block is required
events{}

http {
# include the default mime.types to map file extensions to MIME types
server {
include /etc/nginx/mime.types;
add_header Access-Control-Allow-Origin *;

server {
add_header Access-Control-Allow-Origin *;

listen 8080;
listen 8080;

root /usr/share/nginx/html;
root /usr/share/nginx/html;

location /ui/example-content/ui/ {
try_files $uri $uri/ /ui/example-content/ui/index.html =404;
}
location /ui/example-content/ui/ {
try_files $uri $uri/ /ui/example-content/ui/index.html =404;
}
}
}