From c392c30cac93a59a58aca770652c146bed21ff9a Mon Sep 17 00:00:00 2001 From: andreas-deazevedo Date: Tue, 17 Dec 2024 17:56:38 +0100 Subject: [PATCH] RISDEV-5879 Create dockerfiles --- .talismanrc | 2 ++ Dockerfile | 19 +++++++++++++++++++ prod.Dockerfile | 21 +++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 Dockerfile create mode 100644 prod.Dockerfile diff --git a/.talismanrc b/.talismanrc index 766da70..042f9ee 100644 --- a/.talismanrc +++ b/.talismanrc @@ -4,6 +4,8 @@ scopeconfig: fileignoreconfig: - filename: lefthook.yml checksum: 8168972ed7d27ebebc6e2c33243fad92abe4f859f3bd2edb0c3b171940cac0ec + - filename: prod.Dockerfile + checksum: 67b03670b7d83e3d7439ed38beaa7bf44e645bdabd69526a820f21d5dbb945f3 allowed_patterns: # allow these specific patterns that include hex encoded text diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..950aece --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM node:23.1.0 + +# make the 'app' folder the current working directory +WORKDIR /frontend + +# copy both 'package.json' and 'package-lock.json' (if available) +COPY /frontend/package*.json ./ + +# install project dependencies +RUN npm install + +# copy project files and folders to the current working directory (i.e. 'app' folder) +COPY /frontend/. . + +# build app for production with minification +RUN npm run build + +EXPOSE 5173 +CMD [ "npm", "run", "dev", "--", "--host" ] \ No newline at end of file diff --git a/prod.Dockerfile b/prod.Dockerfile new file mode 100644 index 0000000..e6efa3d --- /dev/null +++ b/prod.Dockerfile @@ -0,0 +1,21 @@ +FROM node:23.1.0 + +# make the 'app' folder the current working directory +WORKDIR /frontend + +# copy both 'package.json' and 'package-lock.json' (if available) +COPY /frontend/package*.json ./ + +# install project dependencies +RUN npm install + +# copy project files and folders to the current working directory (i.e. 'app' folder) +COPY /frontend/. . + +# build app for production with minification +RUN npm run build + +FROM cgr.dev/chainguard/nginx@sha256:9cbce3d5ee2bf696232931119919c2db19e7272cddb0fae0dc0602e78281b688 +EXPOSE 8081 +COPY /frontend/dist /var/lib/nginx/html +COPY nginx.conf /etc/nginx/conf.d/ris-adm-vwv.conf \ No newline at end of file