feat: add docker

このコミットが含まれているのは:
xiang 2023-05-04 21:47:53 +08:00
コミット 53daea3db6
3個のファイルの変更45行の追加0行の削除

15
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

ファイルの表示

@ -42,3 +42,17 @@ By using this repository or any code related to it, you agree to these terms. Th
<img src="https://media.giphy.com/media/LnQjpWaON8nhr21vNW/giphy.gif" width="100" align="left">
Just API's from some language model sites.
## Run local
```shell
yarn
yarn start
```
## Deploy with docker-compose
```
docker-compose up --build -d
```

16
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