From 85387c15fecce26b704dd312b2a9b22aa04ad9c9 Mon Sep 17 00:00:00 2001 From: Tudor Stanciu Date: Sat, 26 Dec 2020 02:27:53 +0200 Subject: [PATCH] docker support --- .dockerignore | 6 ++++++ .env.production | 2 ++ dockerfile | 28 ++++++++++++++++++++++++++++ private/docker-notes.txt | 1 + 4 files changed, 37 insertions(+) create mode 100644 .dockerignore create mode 100644 .env.production create mode 100644 dockerfile create mode 100644 private/docker-notes.txt diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..03f2ba5 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.git +node_modules +build +__mocks__ +.vscode +helm \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..d29e364 --- /dev/null +++ b/.env.production @@ -0,0 +1,2 @@ +PUBLIC_URL=/network-resurrector/ +REACT_APP_IDENTITY_AUTHENTICATION_URL=https://toodle.ddns.net/identity-server-api/identity/authenticate?UserName={username}&Password={password} \ No newline at end of file diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..4cbceaf --- /dev/null +++ b/dockerfile @@ -0,0 +1,28 @@ +# build environment +FROM node:12 as builder +WORKDIR /app + +COPY package*.json ./ +RUN npm install + +COPY . ./ +RUN npm run build + +# production environment +FROM node:12 +RUN printf '\n\n- Copy application files\n' + +ARG APP_SUBFOLDER=network-resurrector + +COPY --from=builder /app/build ./application/${APP_SUBFOLDER} +COPY --from=builder /app/build/index.html ./application/ + +#install static server +RUN npm install -g serve + +#set workdir to root +WORKDIR / + +EXPOSE 80 + +CMD ["sh", "-c", "serve -s application -p 80"] \ No newline at end of file diff --git a/private/docker-notes.txt b/private/docker-notes.txt new file mode 100644 index 0000000..c0ae62c --- /dev/null +++ b/private/docker-notes.txt @@ -0,0 +1 @@ +#test \ No newline at end of file