Code4HR / okcandidate-v1

A platform for matching candidates with voters.
http://okcandidate.code4hr.org
MIT License
15 stars 8 forks source link

Update the Docker setup #281

Closed rydente closed 7 years ago

rydente commented 7 years ago

Update the Docker setup to use version 3 along with some practises in order to simplify the Docker setup a bit and also help assist Swarm deployment.

Signed-off-by: Ryan Y ryayak1460@protingumas.org

qwo commented 7 years ago

you're awesome @rydente!

rydente commented 7 years ago

Thanks, @stanzheng! It's been a while since I've ran OkC locally or otherwise, so I'd want someone to verify this keeps everything working as intended.

qwo commented 7 years ago

getting a knex issue but could be the credentals I set in the ENV.

Does compose configure the postgres containers from .env or elsewhere?

app_1  | npm info ok
app_1  | npm info it worked if it ends with ok
app_1  | npm info using npm@4.1.2
app_1  | npm info using node@v7.7.3
app_1  | npm info lifecycle okcandidate@1.0.0~prestart: okcandidate@1.0.0
app_1  | npm info lifecycle okcandidate@1.0.0~start: okcandidate@1.0.0
app_1  |
app_1  | > okcandidate@1.0.0 start /usr/src/app
app_1  | > node server.js
app_1  |
app_1  | (node:58) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
app_1  | 22 Mar 19:53:44 - Server started at: http://0.0.0.0:8000
app_1  | Knex:Error Pool2 - Error: connect ECONNREFUSED 127.0.0.1:5432
app_1  | Knex:Error Pool2 - Error: connect ECONNREFUSED 127.0.0.1:5432
rydente commented 7 years ago

Yes, from .env. If you copy over .env-example to .env, then you'll have a basic configuration.

At least, that's where OKCandidate gets the location of the database from.

qwo commented 7 years ago

seems to work. host is binded to localhost. I imagine the rest of the view is still #WIP what @wbprice and @ttavenner are actively workign on