versx / PoGoEventWatcher

12 stars 11 forks source link

Docker support #21

Open MC0R3 opened 1 year ago

MC0R3 commented 1 year ago

Hi there,

Finally got GitHub sorted out on my local machine 😅.

Anyway, I've created a docker-compose.yml file as well as the Dockerfile. Running npm run create-locales does currently display an error:

Error: ENOENT: no such file or directory, open '/app/static/locales/de.json'
    at Object.openSync (node:fs:599:3)
    at Object.readFileSync (node:fs:467:35)
    at /app/dist/services/create-locales.js:26:24
    at Generator.next (<anonymous>)
    at /app/dist/services/create-locales.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/app/dist/services/create-locales.js:4:12)
    at /app/dist/services/create-locales.js:24:55
    at Array.map (<anonymous>)
    at /app/dist/services/create-locales.js:24:39 {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/app/static/locales/de.json'
}

Node.js v18.6.0
npm notice 
npm notice New minor version of npm available! 8.13.2 -> 8.15.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.15.0
npm notice Run npm install -g npm@8.15.0 to update!
npm notice

I got this local and on my server; the file just isn't being created when running the command. Maybe a small bug that needs a little attention? :)

Fabio1988 commented 1 year ago

It seems that the workdir is not set properly . You set app/eventwatcher as workdir but somehow locales are looked up in app/static

And you added some personal folder into the yml EventWatcher, use relative paths instead

MC0R3 commented 1 year ago

Using the command without docker also gives me the same error though, that's why I thought there was a small bug regarding the German file. Also tried setting a path in docker-compose to copy the files over but the names aren't formatted properly in Discord; probably because that one files seems to be missing from the filestructure

Some screenshots for reference: Server: https://capture.dropbox.com/eW55k7A3ilupW3RT Discord: https://capture.dropbox.com/WO9Hl4j4TIAAPrry

MC0R3 commented 1 year ago

Just so I can be complete as I can be:

Running npm run create-locales on local: https://capture.dropbox.com/c7UKmz5SwzQ9XQvm Running npm run create-locales with docker-compose: textlog

Both configurations have the issue that the names of the Pokémon are formatted as poke####_

My locale in config.json is set to en (thought I also add this part of the info)

MC0R3 commented 1 year ago

Last post for today (I swear 🙈 ). I dived into the docker-container to check out the file formatting and came up with the following:

root@v2202111159943167776:~/Tools# docker exec 2351d7724bb5 ls /app/
Dockerfile
README.md
dist
examples
node_modules
package-lock.json
package.json
src
static
tsconfig.json
root@v2202111159943167776:~/Tools# docker exec 2351d7724bb5 ls /app/static/
locales
root@v2202111159943167776:~/Tools# docker exec 2351d7724bb5 ls /app/static/locales
_de.json
_en.json
_es.json
fr.json
it.json
ja.json
ko.json
pl.json
pt-br.json
ru.json
sv.json
th.json
tr.json
zh-tw.json
root@v2202111159943167776:~/Tools# 

Looking at creating-locales.js; it seems that the german file should be coming along from another repo but for some reason doesn't (checked the other repo too, the file is there obviously). Looks like something is stopping the script from fetching that specific file.

MC0R3 commented 1 year ago

Updated Dockerfile & docker-compose.example.yml as well as README.md

Problem persists with catching locales for en.json & de.json as described in #22

Once that is fixed, merge should be okay 😄 (obviously I'll test 😅)

MC0R3 commented 1 year ago

I managed to get it worked by copying the files in static/locales/ and removing the underscore. From that point one, the npm run create-locales didn't error anymore. Up and running in Docker now 🥳

MC0R3 commented 1 year ago

Also #18 can be closed as of now :)