From aff328ca6bdaf669fa21af36eef924678e25bba1 Mon Sep 17 00:00:00 2001 From: Anshuman Upadhyay Date: Sat, 24 Feb 2024 00:36:32 +0530 Subject: [PATCH] Added docker file to enable easy running Faced an issue with Current Node version(20.11.1). This starter folder was failing and had to literally shift my attention from Three.js video to getting the Red ring. Added a docker file so that others can run this in future. --- Dockerfile | 10 ++++++++++ development-compose.yml | 7 +++++++ readme.md | 11 +++++++++++ 3 files changed, 28 insertions(+) create mode 100644 Dockerfile create mode 100644 development-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..30992a6e0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +From node:14-alpine + +WORKDIR /app + +COPY . /app + +EXPOSE 8080 + +RUN npm install +CMD ["npm", "run", "dev"] diff --git a/development-compose.yml b/development-compose.yml new file mode 100644 index 000000000..47e66b1fd --- /dev/null +++ b/development-compose.yml @@ -0,0 +1,7 @@ +services: + threejs: + build: + context: . + dockerfile: ./Dockerfile + ports: + - 8080:8080 diff --git a/readme.md b/readme.md index 7c16d5456..6e9ff822f 100644 --- a/readme.md +++ b/readme.md @@ -15,3 +15,14 @@ npm run dev # Build for production in the dist/ directory npm run build ``` +## Setup with Docker +Download [Docker](https://www.docker.com/products/docker-desktop/) + +RUN the following command: +``` bash +# Build the container with compatible webpack node version + +docker compose -f development-compose.yml up +``` + +After compilation, the Red ring must be visible.