Addono / secret-hitler

A web adaptation of the social deduction board game Secret Hitler. This fork includes work to run the application using docker-compose.
https://aknapen.nl/blog/containerizing-secret-hitler-io/
Other
11 stars 1 forks source link

Latest Docker Image seems to be breaking Deployment #71

Closed oolfloo closed 3 years ago

oolfloo commented 3 years ago

Hi and first of all thanks for this very nice Docker-Implementation!

I think I may have discovered a bug with the the Dockerimage addono/secret-hitler:latest / addono/secret-hitler:32f7bf7e. When using this image with the docker-compose.yaml provided in the current master, it seems the application has issues connecting to redis:

secret-hitler_1 | WARN: No oauth client data in .env secret-hitler_1 | /application/node_modules/mongodb/lib/operations/mongo_client_ops.js:474 secret-hitler_1 | throw err; secret-hitler_1 | ^ secret-hitler_1 | secret-hitler_1 | Error: Error connecting to db: failed to connect to server [mongodb:27017] on first connect [Error: connect ECONNREFUSED 172.18.0.3:27017 secret-hitler_1 | at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { secret-hitler_1 | name: 'MongoNetworkError', secret-hitler_1 | errorLabels: [Array], secret-hitler_1 | [Symbol(mongoErrorContextSymbol)]: {} secret-hitler_1 | }] secret-hitler_1 | at /application/node_modules/connect-mongodb-session/index.js:75:17 secret-hitler_1 | at /application/node_modules/mongodb/lib/utils.js:415:14 secret-hitler_1 | at executeCallback (/application/node_modules/mongodb/lib/utils.js:404:25) secret-hitler_1 | at /application/node_modules/mongodb/lib/operations/mongo_client_ops.js:293:21 secret-hitler_1 | at connectCallback (/application/node_modules/mongodb/lib/operations/mongo_client_ops.js:249:5) secret-hitler_1 | at /application/node_modules/mongodb/lib/operations/mongo_client_ops.js:471:7 secret-hitler_1 | at processTicksAndRejections (internal/process/task_queues.js:79:11)

When using the older Docker Image addono/secret-hitler:699095fc in the same docker-compose, the application starts without issues.

Addono commented 3 years ago

Hmm, interesting.

So yeah, some background, upstream doesn't care about Docker support nor deploying Redis and MongoDB separately. So they hardcode the host for both services as localhost or 127.0.0.1. So this fork needs to manually fix these occurrences such that we can set them with environment variables.