From e28f876b749537de7930d0df3a78379792a8bda8 Mon Sep 17 00:00:00 2001 From: Moon Patel Date: Fri, 13 Oct 2023 03:07:39 +0530 Subject: [PATCH] bug fix in backend docker file --- backend/chessbot.js | 6 +++++- backend/dockerfile | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/chessbot.js b/backend/chessbot.js index f98d1da..6c119b1 100644 --- a/backend/chessbot.js +++ b/backend/chessbot.js @@ -1,7 +1,8 @@ +const path = require("path"); const { Engine } = require("node-uci"); require("dotenv").config(); -const engine = new Engine(process.env.CHESS_ENGINE_PATH || "./engine/stockfish16.exe"); +const engine = new Engine(path.join(__dirname, process.env.CHESS_ENGINE_PATH || "engine/stockfish16.exe")); engine .init() @@ -10,6 +11,9 @@ engine }) .then((eng) => { eng.setoption("UCI_Elo"); + }) + .catch((err) => { + console.error(err); }); const nextMove = async ({ position }) => { diff --git a/backend/dockerfile b/backend/dockerfile index 4352023..0179c69 100644 --- a/backend/dockerfile +++ b/backend/dockerfile @@ -15,6 +15,6 @@ RUN npm install --silent COPY . . # Exports -EXPOSE 5000 +EXPOSE 8080 -CMD ["npm","start"] \ No newline at end of file +CMD ["node","app.js"] \ No newline at end of file