From 53daea3db6a9754afbcc26a31f855cb35de6d33d Mon Sep 17 00:00:00 2001 From: xiang <1984871009@qq.com> Date: Thu, 4 May 2023 21:47:53 +0800 Subject: [PATCH] feat: add docker --- Dockerfile | 15 +++++++++++++++ README.md | 14 ++++++++++++++ docker-compose.yaml | 16 ++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8c79dae --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM node:18.16.0-alpine + +RUN mkdir -p /usr/src/app + +WORKDIR /usr/src/app + +COPY package.json /usr/src/app/ + +# RUN npm i --registry=https://registry.npm.taobao.org + +COPY . /usr/src/app + +EXPOSE 3000 + +CMD npm start diff --git a/README.md b/README.md index f9438ac..992820e 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,17 @@ By using this repository or any code related to it, you agree to these terms. Th Just API's from some language model sites. + + +## Run local + +```shell +yarn +yarn start +``` + +## Deploy with docker-compose + +``` +docker-compose up --build -d +``` diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..3293f17 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,16 @@ +version: "3.9" + +services: + gpt4free-ts: + build: + context: . + dockerfile: Dockerfile + container_name: gpt4free-ts + image: gpt4free-ts:latest + ports: + - "3000:3000" + restart: always + environment: + # - TZ=Asia/Shanghai + - http_proxy=http://192.168.0.155:10811 + - https_proxy=http://192.168.0.155:10811