Skip to content

Commit

Permalink
docker fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cogentapps committed Mar 15, 2023
1 parent d1e5a0c commit 84c5066
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,7 @@ COPY ./server/src ./src
RUN CI=true sh -c "cd /app && mkdir data && npm run start && rm -rf data"

COPY --from=build /app/build /app/public

LABEL org.opencontainers.image.source="https://github.com/cogentapps/chat-with-gpt"

CMD ["npm", "run", "start"]
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"start": "npx ts-node src/index.ts"
"start": "npx ts-node --logError src/index.ts"
},
"author": "",
"license": "MIT",
Expand Down
4 changes: 4 additions & 0 deletions server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ export default class ChatServer {
}

async initialize() {
if (!fs.existsSync('./data')) {
fs.mkdirSync('./data');
}

await this.objectStore.initialize();;
await this.database.initialize();;

Expand Down

0 comments on commit 84c5066

Please sign in to comment.