From 39f07047426cadca624d491b31e7c36c67fae9e8 Mon Sep 17 00:00:00 2001 From: Vladyslav Samoilenko <101016860+saymolet@users.noreply.github.com> Date: Thu, 2 May 2024 00:30:22 +0300 Subject: Added Dockerfile (#82) --- .dockerignore | 2 ++ Dockerfile | 19 +++++++++++++++++++ README.md | 9 +++++++++ 3 files changed, 30 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5535952 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +cidr.png +README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5aa44d6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM node:13.14.0-alpine as build + +WORKDIR /build +COPY .babelrc package.json webpack.config.js yarn.lock ./ + +RUN set -eux \ + & apk add \ + --no-cache \ + yarn \ + python3 + +RUN yarn +COPY src ./src +RUN yarn run build + +FROM nginx:1.25.5-alpine as nginx + +COPY --from=build /build/dist/ /usr/share/nginx/html +EXPOSE 80/tcp diff --git a/README.md b/README.md index 88eb685..66e006f 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,15 @@ Manually building the static content into the `dist/` directory can be done with $ yarn run build ``` +## Docker + +You can build a Docker Image from an included Dockerfile and run it as a container: + +```bash +docker build -t cidr.xyz:0.1 . +docker run -d --rm -p 80:80 cidr.xyz:0.1 +``` + ## Deployment Deployment is automated from `master` branch via Netlify -- cgit v1.3.1