Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run link-warden through docker-compose #13

Closed
nevertomorrow opened this issue Jul 5, 2022 · 7 comments
Closed

Unable to run link-warden through docker-compose #13

nevertomorrow opened this issue Jul 5, 2022 · 7 comments

Comments

@nevertomorrow
Copy link

I followed the steps from README.md and tried to run it through docker-compose
The only thing I modified in docker-compose.yml is

    ports:
      - 13000:3000

as I have another app using 3000 port

Once it's up, I can see link-warden and link-warden-api keep restarting

docker ps | grep link-warden
19f293c1d366   link-warden_link-warden        "docker-entrypoint.s…"   35 seconds ago       Restarting (127) 4 seconds ago                                                                                                                                                                               link-warden_link-warden_1
a75e107d1c1b   link-warden_link-warden-api    "docker-entrypoint.s…"   About a minute ago   Restarting (1) 8 seconds ago                                                                                                                                                                                 link-warden_link-warden-api_1
58b51a340f39   mongo                          "docker-entrypoint.s…"   About a minute ago   Up About a minute                0.0.0.0:27017->27017/tcp, :::27017->27017/tcp                                                                                                                               link-warden_mongo_1

By checking the logs:

api docker log

    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/node/server.js:1:17)
    at Module._compile (node:internal/modules/cjs/loader:1112:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:834:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/home/node/server.js' ]
}

Node.js v18.4.0
node:internal/modules/cjs/loader:949
�
  throw err;
  ^

Error: Cannot find module 'express'
Require stack:
- /home/node/server.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:946:15)
    at Module._load (node:internal/modules/cjs/loader:787:27)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/node/server.js:1:17)
    at Module._compile (node:internal/modules/cjs/loader:1112:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:834:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/home/node/server.js' ]
}

link-warden log


> link-warden@0.1.0 go
> react-scripts start

/tmp/go65699788867.sh: line 2: react-scripts: not found

Did I miss anything to config?

Thanks

@axsddlr
Copy link

axsddlr commented Jul 6, 2022

+1 to this

@burkely-00orso69
Copy link

same unfotunately...

@moeenaslam
Copy link

You have to run it with docker compose instead of docker-compose. To run, use docker compose up.
This project uses docker compose V2 and I can say that if you execute docker-compose -v, it will show you version 1.xx.xx whereas now docker comes with compose v2.

@nevertomorrow
Copy link
Author

@moeenaslam Thanks for the suggestion. However, I don't think it is working on my end even if I switched to docker compose.
Here's what I've done.

$ mkdir -p ~/.docker/cli-plugins/
$ curl -SL https://github.com/docker/compose/releases/download/v2.6.1/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
$ chmod +x ~/.docker/cli-plugins/docker-compose

Then I made a quick test

$ docker-compose version
docker-compose version 1.25.0, build unknown
docker-py version: 4.1.0
CPython version: 3.8.10
OpenSSL version: OpenSSL 1.1.1f  31 Mar 2020

$ docker compose version
Docker Compose version v2.6.1

Started with docker compose

$ cd link-warden/
$ docker compose up -d
[+] Running 4/4
 ⠿ Network link-warden_default              Created                                                                0.1s
 ⠿ Container link-warden-mongo-1            Started                                                                0.4s
 ⠿ Container link-warden-link-warden-api-1  Started                                                                0.7s
 ⠿ Container link-warden-link-warden-1      Started                                                                1.0s

However, it was still with same issue

$ docker ps
CONTAINER ID   IMAGE                          COMMAND                  CREATED         STATUS                          PORTS                                                                                                                                                                       NAMES
62068e10300c   link-warden_link-warden        "docker-entrypoint.s…"   8 seconds ago   Restarting (127) 1 second ago                                                                                                                                                                               link-warden-link-warden-1
db5808576db5   link-warden_link-warden-api    "docker-entrypoint.s…"   8 seconds ago   Restarting (1) 1 second ago                                                                                                                                                                                 link-warden-link-warden-api-1

The error logs are the same as I pasted previously.

@nevertomorrow
Copy link
Author

Ok, I made a fresh start by deleting all the existing images + git folder

I used docker compose up -d this time and it's working as expected.

One more thing I should mention is I also tried to use Dockerfile.prod as Dockerfile and it's not working for link-warden_link-warden
link-warden_link-warden is still restarting with error in log:

/docker-entrypoint.sh: exec: line 38: npm: not found

I did noticed a few warnings during build, unfortunately, I didn't capture all of them as they rolled over quickly.

=> => # found 0 vulnerabilities
 => => # npm WARN EBADENGINE Unsupported engine {
 => => # npm WARN EBADENGINE   package: 'react-loader-spinner@6.0.0-0',
 => => # npm WARN EBADENGINE   required: { npm: 'please-use-yarn', yarn: '>= 1.19.1' },
 => => # npm WARN EBADENGINE   current: { node: 'v18.4.0', npm: '8.14.0' }
 => => # npm WARN EBADENGINE }

 => => # npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated
 => => # npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.

  => => # To address all issues (including breaking changes), run:
 => => #   npm audit fix --force
 => => # Run `npm audit` for details.
 => => # > link-warden@0.1.0 build
 => => # > react-scripts build

Using the default Dockerfile (dev version as mentioned in the file) is ok to make the whole app running.

@daniel31x13 Could you update your README.md to emphasize that this project should be using docker compose V2 so that the other users could avoid this issue.

Thanks all.

@daniel31x13
Copy link
Member

Hello @nevertomorrow,
Sorry to be unresponsive.
I applied the changes.

@melyux
Copy link

melyux commented Jun 8, 2023

Got this error and never got the project running. Using docker compose v2. Tried deleting the images and the git folder and trying again, with no luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants