hack4impact-uiuc / h4i-recruitment

H4I recruitment platform
https://h4i-recruitment.vercel.app
17 stars 3 forks source link

Add ability to run with Docker #329

Closed josh-byster closed 5 years ago

josh-byster commented 5 years ago

Resolves #260

This change allows us to run the frontend and backend all at once with no installation needed, just one command: docker-compose up! šŸŽ‰ Also we have the uniformity and reproducibility of bugs among all our developers using Docker with this change.

This is meant to be run in a dev environment, so we use volumes to allow changes made locally to be reflected in the container.

This also addresses factoring out environment variables (fix #328)

Screen Shot 2019-08-12 at 3 46 41 AM
josh-byster commented 5 years ago

Yeah Iā€™d like a Mac/Linux user to test this also to make sure it just works out of the box and Iā€™m not implicitly pulling any environment variables the way Iā€™m doing it now.

tko22 commented 5 years ago

I'm not sure if this would work with deployment using zeit now - maybe test that as well. All the current docker stuff is set up for zeit now deployment, which is why you see this

FROM mhart/alpine-node:10.7.0 as build

The purpose of the multi stage builds is so the final image isn't big, since now has a size limit.

What I would do is I would make another Dockerfile, something like Dockerfile.dev and use that with docker compose.

josh-byster commented 5 years ago

I'm not sure if this would work with deployment using zeit now - maybe test that as well. All the current docker stuff is set up for zeit now deployment

Ah, didn't see that we were using v1 deployments instead of serverless v2 functions. We can easily create a Dockerfile-dev in the backend that Compose pulls from instead, leaving the existing Dockerfile as-is. What are your thoughts @tko22?

josh-byster commented 5 years ago

The purpose of the multi stage builds is so the final image isn't big, since now has a size limit.

What I would do is I would make another Dockerfile, something like Dockerfile.dev and use that with docker compose.

Yes, I agree ā€” I don't think we can use the same image built for Now since we need the dev dependencies for development. I changed the Dockerfile since I thought it was no longer used, but now that I know it's being used to deploy BE, I created a separate file that builds a development image.

tko22 commented 5 years ago

Ah, didn't see that we were using v1 deployments instead of serverless v2 functions. We can easily create a Dockerfile-dev in the backend that Compose pulls from instead, leaving the existing Dockerfile as-is. What are your thoughts @tko22?

Yep sounds good