From 4ace8c1e843a783e96abc6db12f63fc5a39932d8 Mon Sep 17 00:00:00 2001 From: Dennis Postma Date: Fri, 7 Feb 2025 01:48:42 +0100 Subject: [PATCH] Build fix attempt --- Dockerfile | 6 +++--- docker-start.sh | 2 +- package.json | 2 +- tsconfig.json | 4 ++++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0a716d6..cac34cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,8 +26,8 @@ RUN npm run build EXPOSE 80 6379 3306 # Copy and make the startup script executable -COPY docker-start.sh /usr/src/start.sh -RUN chmod +x /usr/src/start.sh +COPY docker-start.sh /usr/src/dist/start.sh +RUN chmod +x /usr/src/dist/start.sh # Use the shell script as the entry point -CMD ["/usr/src/start.sh"] \ No newline at end of file +CMD ["/usr/src/dist/start.sh"] \ No newline at end of file diff --git a/docker-start.sh b/docker-start.sh index a8c2d4e..360d9a1 100644 --- a/docker-start.sh +++ b/docker-start.sh @@ -17,7 +17,7 @@ echo "MySQL is ready!" npx mikro-orm migration:up # Start the Node.js application in a tmux session -tmux new-session -d -s nodeapp "node src/server.js" +tmux new-session -d -s nodeapp "npm run start" echo "App is running in tmux session. Attach with: tmux attach-session -t nodeapp" # Keep container running diff --git a/package.json b/package.json index 164a140..cceb687 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "scripts": { - "start": "node src/server.js", + "start": "node --experimental-specifier-resolution=node dist/server.js", "dev": "nodemon --exec tsx src/server.ts", "build": "tsc", "format": "prettier --write src/", diff --git a/tsconfig.json b/tsconfig.json index cfa92e3..44b2379 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,6 +14,10 @@ "skipLibCheck": true, "noFallthroughCasesInSwitch": true, + // Output + "outDir": "./dist", + "rootDir": "./src", + "baseUrl": ".", "paths": { "#application/*": ["./src/application/*"],