Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Docker #76

Merged
merged 9 commits into from
Apr 12, 2017
Merged

Docker #76

merged 9 commits into from
Apr 12, 2017

Conversation

rydente
Copy link
Collaborator

@rydente rydente commented Mar 28, 2017

This pull request implements a Docker setup for OkCandidate, including a web server (nginx) allowing access over ports 80 and (preferring) 443, the Node.js application server and a PostgreSQL database instance. It addresses #60.

Uses the main concept for node-gyp compilation from nodejs/docker-node#282.

Ryan Y added 6 commits March 28, 2017 11:07
Update the readme so we can get started on OkCandidate using Docker.

Signed-off-by: Ryan Y <[email protected]>
Ignore the environment variable configuration and security certificates
so we can see code changes here, not irrelevant artefacts.

Signed-off-by: Ryan Y <[email protected]>
Define an Alpine Linux Node.js + Python image so we can build packages
which require node-gyp.

Signed-off-by: Ryan Y <[email protected]>
Include an environment variable example file so we can start using
development settings, but also allow developers or admins to switch out
the settings for production if they need to.

Signed-off-by: Ryan Y <[email protected]>
Create a certificate generation script so we can have local development
certificates to test OkCandidate over https with.

Signed-off-by: Ryan Y <[email protected]>
Dockerise OkCandidate with a web server, application server and a
database so we can get this system as close as we can to a production
system.

Signed-off-by: Ryan Y <[email protected]>
Copy link
Member

@BretFisher BretFisher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start.

Look at the old docker-compose.yml for how to setup psql. It should be setting its password on startup, and initializing the db when there isn't any data.

The node design could be better. Right now it'll run npm install on every start, but really, you want that happening during build, not start. See my example node repo for how to solve this. I'm also not a big fan of the npm installs being in a volume, so also refer to my example on how to just install npm dependencies in an upstream folder rather than downstream volume https://github.com/BretFisher/node-docker-good-defaults

Also, we should put these images in the docker hub org like we do for the rest. give me hub accounts in slack or here and I'll add. https://hub.docker.com/u/code4hr/

I feel like there's a way this can all work in a single "docker-compose up" after a git clone for local dev without the "setup steps" but we'll get there :).

After this we can work on adding the deploy options to compose for production.

Nice work.

Merge remote-tracking branch 'upstream/develop' into docker to integrate
the Docker setup with the latest implementation.

Signed-off-by: Ryan Y <[email protected]>
@qwo
Copy link
Member

qwo commented Apr 2, 2017

I pulled and tried this the other day, would the default env allow postgres to bootstrap correctly?

I was getting ECONN errors in relation to that.

Ryan Y added 2 commits April 12, 2017 18:31
Merge remote-tracking branch 'upstream/develop' into docker to integrate
the Docker setup with the latest implementation.

Signed-off-by: Ryan Y <[email protected]>
Use the PostgreSQL environment variables in the Docker image so we can
configure PostgreSQL and Trails to automatically create the database
schema needed.

Signed-off-by: Ryan Y <[email protected]>
@qwo qwo merged commit ebc6308 into Code4HR:develop Apr 12, 2017
@qwo
Copy link
Member

qwo commented Apr 13, 2017

Ok so noticing auto rebuilding doesn't happen with frontend weird.
@rydente can you confirm the shared volume config looks right

@rydente
Copy link
Collaborator Author

rydente commented Apr 13, 2017

Hey @stanzheng just saw this, what's going on? Something like gulp watch isn't working? Or the dist didn't get moved over or something?

EDIT: Just tried locally, edited a component and the changes showed up in the panel. Did you mean something else?

EDIT EDIT: I do see a possible server render which doesn't show the changes, but immediately after that if you refresh the changes do show up:

2017-04-13 15-24-11

Then refreshing:

2017-04-13 15-24-46

@qwo
Copy link
Member

qwo commented Apr 14, 2017

I'm seeing it reload fine on main routes after webpack rebuilds (may flash a bit) but
a view like /login for whatever reason. I thought maybe it's related to how its handled in the routes but it doesn't look related. Strange!
https://github.com/Code4HR/okcandidate-platform/blob/develop/frontend/js/components/ecosystems/LoginForm.js

@rydente rydente mentioned this pull request Apr 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants