Skip to content

Dockerize Webapp#335

Closed
beekley wants to merge 8 commits intomasterfrom
dockerize
Closed

Dockerize Webapp#335
beekley wants to merge 8 commits intomasterfrom
dockerize

Conversation

@beekley
Copy link
Contributor

@beekley beekley commented Feb 25, 2020

addresses #326 (semi-related)

Motivation and context

To run end-to-end tests, we'll have to have a real instance of the app running. Docker will help simplify this process by handling the setup/build/running of the app. It will also make the development environments more consistent since everyone will run the same environment in a container.

What I did

  • Update the Dockerfile for the node webapp, which builds the dependencies in the container while keeping the code local to the host. This allows nodemon to continue to work.
  • Reorganize the config files to support an additional dev environment (dev-docker).
  • Update the readme to use docker. This could like be simplified further by moving the frontend/mongo setup steps to the Dockerfile.

I'd like a reviewer to test running docker on their machine.

@beekley
Copy link
Contributor Author

beekley commented Feb 25, 2020

Looks redundant w/ #334

@beekley beekley closed this Feb 25, 2020
@beekley
Copy link
Contributor Author

beekley commented Mar 10, 2020

Built on #334

@beekley beekley reopened this Mar 10, 2020

cp -r /usr/src/cache/node_modules/. /usr/src/app/node_modules/
# exec npm run build
exec npm run start-docker
Copy link
Contributor

Choose a reason for hiding this comment

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

does using the entrypoint allow you to watch/rebuild during local development?

} else {
mongoose.connect(mongoUri, { useNewUrlParser: true });
}
mongoose.connect(config.mongoUri, config.mongoOptions);
Copy link
Contributor

Choose a reason for hiding this comment

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

😂

});
}
var sessionStore = new MongoStore({
url: config.mongoUri,
Copy link
Contributor

Choose a reason for hiding this comment

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

thank you

"seed": "mongoimport -c users --uri mongodb://localhost:27017/hellogov --drop --file conf/seeds.json",
"start": "NODE_ENV=production node index.js",
"start-dev": "NODE_ENV=development nodemon index.js",
"start-docker": "NODE_ENV=dev-docker nodemon index.js",
Copy link
Contributor

Choose a reason for hiding this comment

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

ok here is the watch

@beekley beekley closed this Apr 29, 2022
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

Successfully merging this pull request may close these issues.

2 participants