Achaak / toogoodtogo-bot

TooGooToGo-Bot is a tool designed to help you stay informed about the availability of your favorite stores on the Too Good To Go platform. It sends notifications, allowing you to quickly find and purchase food products before they disappear.
MIT License
61 stars 17 forks source link

Docker container fails at run time. #17

Closed saveriogzz closed 1 year ago

saveriogzz commented 1 year ago

Hey @Achaak, thanks for the project! :)

I commented on #15 but it's probably better to open an issue for this.

I tried building and running with Docker but it's not working for me. Does it work for you guys? This is my stacktrace:

❯ docker run -p 3000:3000 -it saveriogzz/toogoodtogobot
yarn run v1.22.19
$ ts-node ./dist/src/index.js
node:internal/modules/cjs/loader:959
  throw err;
  ^

Error: Cannot find module './index.js'
Require stack:
- /app/dist/src/imaginaryUncacheableRequireResolveScript
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
    at Function.resolve (node:internal/modules/cjs/helpers:108:19)
    at requireResolveNonCached (/app/node_modules/ts-node/dist/bin.js:489:16)
    at getProjectSearchDir (/app/node_modules/ts-node/dist/bin.js:459:40)
    at phase3 (/app/node_modules/ts-node/dist/bin.js:263:27)
    at bootstrap (/app/node_modules/ts-node/dist/bin.js:44:30)
    at main (/app/node_modules/ts-node/dist/bin.js:32:12)
    at Object.<anonymous> (/app/node_modules/ts-node/dist/bin.js:519:5)
    at Module._compile (node:internal/modules/cjs/loader:1126:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/app/dist/src/imaginaryUncacheableRequireResolveScript' ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Achaak commented 1 year ago

I updated the docker file with yarn and deleted npm on the project Now, it should work 😉