Note: The node_modules
folder should be deleted, as it may contain incompatible module versions (not suited for your OS).
- Update project info, add the script block, the dependencies should stay as exported by replit (included here for completeness).
File: package.json
{
"name": "kaboom-env",
"scripts": {
"prerequesites": "npx --yes rimraf node_modules && npm install",
"test": "node run.js",
"docker:test": "npm run prerequesites && npm test",
"start": "npx http-server ./dist --port 8000",
"docker:start": "npm run prerequesites && npm start"
},
"dependencies": {
"@replit/database": "^2.0.2",
"esbuild": "^0.15.10",
"express": "^4.18.1",
"kaboom": "^2000.2.9",
"stacktrace-js": "^2.0.2",
"ws": "^8.2.0"
}
}
can be tested by npm start
- add compose file:
docker-compose.yaml
version: "2"
services:
node:
image: "node:19-alpine"
user: "node"
working_dir: /app
environment:
- NODE_ENV=production
volumes:
- ./:/app
ports:
- "8000:8000"
expose:
- "8000"
command: "npm run docker:start"
can be used with docker compose up
, open the browser at http://localhost:8000