From d5bfeaa3053fd19b371b68887b8e660b46621cc8 Mon Sep 17 00:00:00 2001 From: mmohad Date: Thu, 16 May 2024 17:46:25 +0200 Subject: [PATCH 1/5] add(docker): dockerise for dev --- Dockerfile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..c6237ece62 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:16.13.0-alpine AS builder + +WORKDIR /app + +COPY ./dist . + + +FROM nginx:stable-alpine + +WORKDIR /usr/share/nginx/htmlRUN rm -rf ./* + +COPY --from=builder /app/apps/datahub /usr/share/nginx/html + + +RUN sed -i '10i \\ttry_files $uri $uri/ /index.html;' /etc/nginx/conf.d/default.conf + +ENTRYPOINT ["nginx", "-g", "daemon off;"] \ No newline at end of file From 9fec4675d91b1045bd04754c3fa447e092b5acbf Mon Sep 17 00:00:00 2001 From: mmohad Date: Thu, 16 May 2024 17:52:35 +0200 Subject: [PATCH 2/5] fix(dockerfile): build prod --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c6237ece62..1e33e0b6a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,10 @@ FROM node:16.13.0-alpine AS builder WORKDIR /app -COPY ./dist . +COPY . . +RUN npm install +RUN npx nx build datahub FROM nginx:stable-alpine From 23ddf4367f8ed7ab8e20a4f628c7ba81b7815e5c Mon Sep 17 00:00:00 2001 From: mmohad Date: Thu, 16 May 2024 17:55:50 +0200 Subject: [PATCH 3/5] fix(docker): fix path app --- Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1e33e0b6a4..6ac577d23e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,8 @@ WORKDIR /app COPY . . RUN npm install -RUN npx nx build datahub + +RUN npx nx build apps/datahub FROM nginx:stable-alpine From e947fa082dc53db9c945de0b2c52ec4ea3ae2ae3 Mon Sep 17 00:00:00 2001 From: mmohad Date: Thu, 16 May 2024 18:04:56 +0200 Subject: [PATCH 4/5] fix(docker): fix path --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6ac577d23e..90ab993fad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,8 @@ WORKDIR /app COPY . . -RUN npm install -RUN npx nx build apps/datahub +RUN npx nx build app/datahub FROM nginx:stable-alpine From 5306f192ec141b66d3e8c4b929707a20da6b6ca3 Mon Sep 17 00:00:00 2001 From: mmohad Date: Thu, 16 May 2024 18:06:32 +0200 Subject: [PATCH 5/5] fix(docker): missing install --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 90ab993fad..410f99033f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,7 @@ WORKDIR /app COPY . . +RUN npm install RUN npx nx build app/datahub