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

docker run example does not work #362

Open
pascalandy opened this issue Dec 22, 2020 · 3 comments
Open

docker run example does not work #362

pascalandy opened this issue Dec 22, 2020 · 3 comments
Labels

Comments

@pascalandy
Copy link

pascalandy commented Dec 22, 2020

Hello folks,

I'm really confortable with Docker. The example in the README doesn't work.
I also feel there should be at least one volume mount as there are some stateful element to this app.

build

$ docker build --tag haste-server .
Sending build context to Docker daemon  1.976MB
Step 1/17 : FROM node:14.8.0-stretch
14.8.0-stretch: Pulling from library/node
419e7ae5bb1e: Pull complete 
848839e0cd3b: Pull complete 
de30e8b35015: Pull complete 
258fdea6ea48: Pull complete 
ddb75eb7f1e9: Pull complete 
7ec8a0667334: Pull complete 
c6d8dab5779d: Pull complete 
d3ae9be01b42: Pull complete 
38ff96b6f833: Pull complete 
Digest: sha256:8b6401f8d15c900736a54a870994277b3de19ebd28cc483c497bf00d608e2a90
Status: Downloaded newer image for node:14.8.0-stretch
 ---> 784e696f5060
Step 2/17 : RUN mkdir -p /usr/src/app &&     chown node:node /usr/src/app
 ---> Running in cc6087545ab7
Removing intermediate container cc6087545ab7
 ---> 9672d876a41b
Step 3/17 : USER node:node
 ---> Running in da827c6ff912
Removing intermediate container da827c6ff912
 ---> 6a9980d21b34
Step 4/17 : WORKDIR /usr/src/app
 ---> Running in f5180bb820f1
Removing intermediate container f5180bb820f1
 ---> ce8160c3c924
Step 5/17 : COPY --chown=node:node . .
 ---> 34378dae8e43
Step 6/17 : RUN npm install &&     npm install [email protected] &&     npm install [email protected] &&     npm install [email protected] &&     npm install [email protected] &&     npm install [email protected]
 ---> Running in ce01cbc61183
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 205 packages from 126 contributors and audited 204 packages in 5.557s

31 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ [email protected]
updated 1 package and audited 204 packages in 1.77s

31 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ [email protected]
added 2 packages from 6 contributors, removed 8 packages, updated 7 packages and audited 198 packages in 2.159s

31 packages are looking for funding
  run `npm fund` for details

found 1 high severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ [email protected]
added 6 packages from 4 contributors and audited 204 packages in 2.223s

31 packages are looking for funding
  run `npm fund` for details

found 1 high severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ [email protected]
added 12 packages from 65 contributors and audited 216 packages in 5.62s

31 packages are looking for funding
  run `npm fund` for details

found 1 high severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ [email protected]
added 2 packages from 2 contributors and audited 218 packages in 2.349s

31 packages are looking for funding
  run `npm fund` for details

found 1 high severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details
Removing intermediate container ce01cbc61183
 ---> 22a2815efd4a
Step 7/17 : ENV STORAGE_TYPE=memcached     STORAGE_HOST=127.0.0.1     STORAGE_PORT=11211    STORAGE_EXPIRE_SECONDS=2592000    STORAGE_DB=2     STORAGE_AWS_BUCKET=     STORAGE_AWS_REGION=     STORAGE_USENAMER=     STORAGE_PASSWORD=     STORAGE_FILEPATH=
 ---> Running in 3bc8d45ed8c7
Removing intermediate container 3bc8d45ed8c7
 ---> 4e07e1c8bc07
Step 8/17 : ENV LOGGING_LEVEL=verbose     LOGGING_TYPE=Console     LOGGING_COLORIZE=true
 ---> Running in 82f157a0d772
Removing intermediate container 82f157a0d772
 ---> 01c0d939a006
Step 9/17 : ENV HOST=0.0.0.0    PORT=7777    KEY_LENGTH=10    MAX_LENGTH=400000    STATIC_MAX_AGE=86400    RECOMPRESS_STATIC_ASSETS=true
 ---> Running in 18f7be76576e
Removing intermediate container 18f7be76576e
 ---> 4fd4df77384f
Step 10/17 : ENV KEYGENERATOR_TYPE=phonetic     KEYGENERATOR_KEYSPACE=
 ---> Running in 68125e22e621
Removing intermediate container 68125e22e621
 ---> dcd67efbf935
Step 11/17 : ENV RATELIMITS_NORMAL_TOTAL_REQUESTS=500    RATELIMITS_NORMAL_EVERY_MILLISECONDS=60000     RATELIMITS_WHITELIST_TOTAL_REQUESTS=     RATELIMITS_WHITELIST_EVERY_MILLISECONDS=      RATELIMITS_WHITELIST=example1.whitelist,example2.whitelist         RATELIMITS_BLACKLIST_TOTAL_REQUESTS=     RATELIMITS_BLACKLIST_EVERY_MILLISECONDS=     RATELIMITS_BLACKLIST=example1.blacklist,example2.blacklist
 ---> Running in d4a0b484d2c1
Removing intermediate container d4a0b484d2c1
 ---> 44c1f1d932d4
Step 12/17 : ENV DOCUMENTS=about=./about.md
 ---> Running in eaafda1689b0
Removing intermediate container eaafda1689b0
 ---> 8c1241572334
Step 13/17 : EXPOSE ${PORT}
 ---> Running in 2138d5b69260
Removing intermediate container 2138d5b69260
 ---> a922541aff1d
Step 14/17 : STOPSIGNAL SIGINT
 ---> Running in 6412a8fa65d8
Removing intermediate container 6412a8fa65d8
 ---> 3b87ace285bb
Step 15/17 : ENTRYPOINT [ "bash", "docker-entrypoint.sh" ]
 ---> Running in 08df2d905800
Removing intermediate container 08df2d905800
 ---> a99768702307
Step 16/17 : HEALTHCHECK --interval=30s --timeout=30s --start-period=5s     --retries=3 CMD [ "curl" , "-f" "localhost:${PORT}", "||", "exit", "1"]
 ---> Running in 538e1b81e4c3
Removing intermediate container 538e1b81e4c3
 ---> 49750056cb9f
Step 17/17 : CMD ["npm", "start"]
 ---> Running in 7b2fe095a522
Removing intermediate container 7b2fe095a522
 ---> 99110c03cbe1
Successfully built 99110c03cbe1
Successfully tagged haste-server:latest

logs

Redis connection to redis-server:6379 failed - getaddrinfo ENOTFOUND

$ docker logs -f haste-server-container

> [email protected] start /usr/src/app
> node server.js

info: configuring redis
info: compressed application.js into application.min.js
info: loading static document name=about, path=./about.md
info: listening on 0.0.0.0:7777
error: error connecting to redis index 2 error=Redis connection to redis-server:6379 failed - getaddrinfo ENOTFOUND redis-server
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/node/.npm/_logs/2020-12-22T15_50_21_598Z-debug.log

debug log

I mounted the logs DIR but it's empty

docker run --name haste-server-container -v $(pwd)/logs:/home/node/.npm/_logs --env STORAGE_TYPE=redis --env STORAGE_HOST=redis-server --env STORAGE_PORT=6379 haste-server

Thanks!

@pascalandy
Copy link
Author

I was able to run haste server via two old projects, but it does not make sense to use these in 2020.

compose

https://github.com/frdmn/docker-hastebin

dockerfile

https://github.com/rlister/dockerfiles/tree/master/hastebin

@jonasled
Copy link

it looks like the haste server can't resolve the dns name redis-server. I use a IP in my setup and it works without any problems.

@github-actions
Copy link

github-actions bot commented Mar 8, 2022

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Mar 8, 2022
@filipechagas filipechagas added triage and removed stale labels Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants