At MHacks, we utilize Docker to containerize our application so that whether you are using linux, macOS, or Windows, you run exactly the same as everyone else. There are a lot of other advantages to docker too. All the dependencies are automatically installed for you, it is great for ease of deployment, it provides good isolation and security, and much more.
- Get Docker
- Get Docker Compose
- Clone this repo:
git clone https://github.com/mhacks/mhacks-web
- Change directory to the deploy repo:
cd mhacks-web/deploy/
- Start whatever environment you want
- Development
docker-compose -f development.yml up -d
- NOTE: Your git repo will be linked to the development environment, so your local changes will be reflected with a container restart
- Production (You're gonna need some more env data)
docker-compose -f production.yml up -d
- NOTE: This takes care of setting up NGINX AND LetsEncrypt with the appropriate hosts (and autorenewal!).
- Development
- Access
http://localhost:3000
and start developing!
This will start the necessary containers and hook you into their output. In addition to being able to see what is happening, you can stop the containers easily by just Ctrl-Cing out of them.
DEBUG=* docker-compose -f development.yml up -d
When working exclusively on backend, you don't want to wait for Webpack to reload the frontend on each save, especially when you haven't changed anything there.
APIWORK=true docker-compose -f development.yml up -d