From 066f0c0632afd32b725ef5f822014b9baf5ff316 Mon Sep 17 00:00:00 2001 From: Diggaj Upadhyay Date: Mon, 16 May 2022 03:41:36 +0800 Subject: [PATCH 1/2] add docker & docker-compose --- Dockerfile | 13 +++++++++++++ docker-compose.yml | 14 ++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..32f6a64 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:18-alpine as base + +WORKDIR /home/node/app +COPY package.json ./ +RUN npm install -g npm-check-updates +RUN ncu -u +RUN npm install +COPY . ./ + +FROM base as production + +ENV NODE_PATH=./build +RUN npm run build diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..515baa8 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: "3.7" +services: + liveterm: + build: + context: . + dockerfile: Dockerfile + target: base + expose: + - '3000' + ports: + - '3000:3000' + volumes: + - ./src/:/home/node/app/src + command: npm run dev From cc1f2f5300fb86db6d545fa13268f24dc602a39d Mon Sep 17 00:00:00 2001 From: Diggaj Upadhyay Date: Mon, 16 May 2022 03:55:23 +0800 Subject: [PATCH 2/2] add docker instruction --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index c50c795..4e7985e 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,17 @@ Then install dependencies and start developing there: yarn install && yarn dev ``` +### Docker Usage +- Clone the project. +- Edit `config.json`. +- Run the following to start the service (from within the project dir): +````shell +docker-compose up -d +```` + +You can also try changing `Dockerfile` & `docker-compose.yml` ONLY IF YOU KNOW WHAT YOU ARE DOING! +Learn about Docker [here](https://docs.docker.com/get-started/overview/ "here"). + ## 📄 Configuration ### Basic Configuration