...
 
Commits (3)
    https://gitcode.net/fuzhengwei/chatbot-api/-/commit/5ec4686258f209049fa3f951f8f65ad0ffa9caab 小傅哥,feat:第6节:部署服务到 Docker 容器 2023-01-19T14:52:07+08:00 小傅哥 184172133@qq.com https://gitcode.net/fuzhengwei/chatbot-api/-/commit/8006911ced4b5085e551fd958a8419f0b14d8c58 小傅哥,feat:配置信息 2023-01-19T14:54:19+08:00 小傅哥 184172133@qq.com https://gitcode.net/fuzhengwei/chatbot-api/-/commit/f430a509f48a6044a718d2d17159c18254a46370 小傅哥,docs:图片 2023-01-20T12:11:45+08:00 小傅哥 184172133@qq.com
......@@ -26,3 +26,4 @@ hs_err_pid*
/*/*.iml
/.idea/
/docs/ppt/~*.pptx
# 基础镜像
FROM openjdk:8-jre-slim
# 作者
MAINTAINER xiaofuge
# 配置
ENV PARAMS=""
# 时区
ENV TZ=PRC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# 添加应用
ADD /chatbot-api-interfaces/target/chatbot-api.jar /chatbot-api.jar
# 执行镜像
ENTRYPOINT ["sh","-c","java -jar $JAVA_OPTS /chatbot-api.jar $PARAMS"]
\ No newline at end of file
# chatbot-api
ChatGPT AI 问答助手
# 《ChatGPT AI 问答助手》开源项目
## 项目介绍
1. 技术栈:Java、SpringBoot、爬虫、ChatGPT、job、Docker
2. OpenAi Keys 申请:[https://beta.openai.com/account/api-keys](https://beta.openai.com/account/api-keys) - 用于处理扫码知识星球问题进行调用获取答案。
## 课程目录
| 目录 | 视频 | Github | Gitcode |
| -------------------------------------------------------- | ---- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| 开篇介绍 | | | |
| 第1节:SpringBoot DDD 工程创建和 Github/Gitcode 仓库使用 | | [【23_xfg_init_project】](https://github.com/fuzhengwei/chatbot-api/tree/23_xfg_init_project) | [【23_xfg_init_project】](https://gitcode.net/fuzhengwei/chatbot-api/-/tree/23_xfg_init_project) |
| 第2节:创建知识星球,爬取接口信息 | | [【23_xfg_zsxq_api】](https://github.com/fuzhengwei/chatbot-api/tree/23_xfg_zsxq_api) | [【23_xfg_zsxq_api】](https://gitcode.net/fuzhengwei/chatbot-api/-/tree/23_xfg_zsxq_api) |
| 第3节:知识星球接口领域服务开发 | | [【23_xfg_zsxq_domain】](https://github.com/fuzhengwei/chatbot-api/tree/23_xfg_zsxq_domain) | [【23_xfg_zsxq_domain】](https://gitcode.net/fuzhengwei/chatbot-api/-/tree/23_xfg_zsxq_domain) |
| 第4节:对接ChatGPT,调用接口; | | [【23_xfg_chatgpt】](https://github.com/fuzhengwei/chatbot-api/tree/23_xfg_chatgpt) | [【23_xfg_chatgpt】](https://gitcode.net/fuzhengwei/chatbot-api/-/tree/23_xfg_chatgpt) |
| 第5节:整合知识星球与ChatGPT,完成自动化回答 | | [【23_xfg_job】](https://github.com/fuzhengwei/chatbot-api/tree/23_xfg_job) | [【23_xfg_job】](https://gitcode.net/fuzhengwei/chatbot-api/-/tree/23_xfg_job) |
| 第6节:打包镜像文件,部署服务到 Docker 容器 | | [【23_xfg_docker】](https://github.com/fuzhengwei/chatbot-api/tree/23_xfg_docker) | [【23_xfg_docker】](https://gitcode.net/fuzhengwei/chatbot-api/-/tree/23_xfg_docker) |
## 加入星球【ChatGPT AI 问答助手】
你可以通过微信扫码,加入知识星球【ChatGPT AI 问答助手】,在手机端对ChatGPT进行提问。
docker build -f ./Dockerfile -t chatbot-api:1.0 .
\ No newline at end of file
......@@ -9,6 +9,8 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<artifactId>chatbot-api-interfaces</artifactId>
<dependencies>
......@@ -85,4 +87,56 @@
</dependency>
</dependencies>
<build>
<finalName>chatbot-api</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/**</include>
</includes>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/**</include>
</includes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<!--该插件主要用途:构建可执行的JAR -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
......@@ -2,6 +2,6 @@ server:
port: 8090
chatbot-api:
groupId: 28885518425541
cookie: __cuid=5330a556392a4c5b8084b4cbc165e0f3; amp_fef1e8=930aec23-e22e-4f11-8864-0389bd5095d1R...1g55hl79m.1g55hl79t.1.1.2; UM_distinctid=183e61195d535b-0bddac94679c75-19525635-1aeaa0-183e61195d7c52; sensorsdata2015jssdkcross={"distinct_id":"241858242255511","first_id":"17ebd0b4317ecb-0b27f672c2d3af-133a6253-1296000-17ebd0b4318ba7","props":{"$latest_traffic_source_type":"直接流量","$latest_search_keyword":"未取到值_直接打开","$latest_referrer":""},"$device_id":"17ebd0b4317ecb-0b27f672c2d3af-133a6253-1296000-17ebd0b4318ba7","identities":"eyIkaWRlbnRpdHlfY29va2llX2lkIjoiMTgwMmQ2YjZiOWIxZjMtMGQ4YzMzZjhmYTA3YmEtMzU3MzZhMDMtMTI5NjAwMC0xODAyZDZiNmI5YzEwODYiLCIkaWRlbnRpdHlfbG9naW5faWQiOiIyNDE4NTgyNDIyNTU1MTEifQ==","history_login_id":{"name":"$identity_login_id","value":"241858242255511"}}; abtest_env=product; zsxqsessionid=8fae9a083a4874ab833c2158a44deb82; zsxq_access_token=5D862869-1229-A9B6-1BC1-C662EC4B16DD_D625BA7FD9CBBDFA
openAiKey: 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
\ No newline at end of file
groupId: 28885518425541 # 知识星球ID
cookie: # 知识星球个人cookie信息
openAiKey: # 自行申请 https://beta.openai.com/overview 或者联系小傅哥 fustack 付费申请【购买虚拟号码等需要支付】。
\ No newline at end of file
# 第6节:部署服务到 Docker 容器
## 资料
```java
vim /usr/lib/systemd/system/docker.service
在ExecStart=/usr/bin/dockerd-current 后面加上 -H tcp://0.0.0.0:2375 -H unix://var/run/docker.sock \
重新加载配置文件
systemctl daemon-reload
重启启动
systemctl restart docker
```
\ No newline at end of file
......@@ -118,10 +118,6 @@
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
......
docker run -p 8090:8090 --name chatbot-api -d chatbot-api:1.0
\ No newline at end of file