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/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 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