Compare commits

...

9 commits

Author SHA1 Message Date
631dd28d9a Merge branch 'main' of https://github.com/artegoser/AnoPaper 2023-09-11 12:01:51 +03:00
e02996355b docker 2023-09-11 12:01:44 +03:00
0045b27287 docker 2023-09-11 11:58:48 +03:00
c34a6fe5c2 Update deploy.yml 2023-09-11 11:20:31 +03:00
b94980a1de Create deploy.yml 2023-09-11 11:16:09 +03:00
36785c20b8 Create captain-definition 2023-09-11 11:12:12 +03:00
62a87f7d36 Delete Build.yml 2023-09-11 11:01:11 +03:00
8ed77ea3f9 Update openai.js 2023-09-11 10:53:21 +03:00
2ae13e6079 Create Build.yml 2023-09-11 10:47:02 +03:00
4 changed files with 26 additions and 2 deletions

2
.dockerignore Normal file
View file

@ -0,0 +1,2 @@
node_modules
dist

13
Dockerfile Normal file
View file

@ -0,0 +1,13 @@
FROM node:18-alpine as build
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build
FROM node:18-alpine as run
WORKDIR /app
COPY --from=build /app/package*.json /app/index.js /app/note_validator.js /app/core.js /usr/src/app/
COPY --from=build /app/dist/ /usr/src/app/dist/
RUN npm install --omit=dev
CMD npm run start
EXPOSE 80

8
docker-compose.yml Normal file
View file

@ -0,0 +1,8 @@
version: "3"
services:
anopaper:
build: .
ports:
- "80:80"
restart: unless-stopped

View file

@ -15,16 +15,17 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { Configuration, OpenAIApi } from "openai";
import OpenAi from "openai";
async function Complete(text) {
document.body.style.cursor = "wait";
let initText = text;
const configuration = new Configuration({
const configuration = new OpenAi({
apiKey: settings.openAiKey,
});
const openai = new OpenAIApi(configuration);
const response = await openai.createCompletion({
model: "text-davinci-003",