docker fixes

main
Cogent Apps 2023-03-15 19:47:47 +00:00
parent d1e5a0cda8
commit 84c5066abd
3 changed files with 9 additions and 1 deletions

View File

@ -37,3 +37,7 @@ COPY ./server/src ./src
RUN CI=true sh -c "cd /app && mkdir data && npm run start && rm -rf data" RUN CI=true sh -c "cd /app && mkdir data && npm run start && rm -rf data"
COPY --from=build /app/build /app/public COPY --from=build /app/build /app/public
LABEL org.opencontainers.image.source="https://github.com/cogentapps/chat-with-gpt"
CMD ["npm", "run", "start"]

View File

@ -4,7 +4,7 @@
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"start": "npx ts-node src/index.ts" "start": "npx ts-node --logError src/index.ts"
}, },
"author": "", "author": "",
"license": "MIT", "license": "MIT",

View File

@ -95,6 +95,10 @@ export default class ChatServer {
} }
async initialize() { async initialize() {
if (!fs.existsSync('./data')) {
fs.mkdirSync('./data');
}
await this.objectStore.initialize();; await this.objectStore.initialize();;
await this.database.initialize();; await this.database.initialize();;