- Preparations
- Assumptions
- Running the environment
- Setting up HTTPS for the Golang Server
- Gitbook for Docker
- Install Docker
- Clone this repo:
git clone https://github.com/jbelmont/docker-workshop.git
- Docker Images:
docker pull mongo:3.4.5
docker pull golang:1.8.3
docker pull redis:3.2.9
docker pull mhart/alpine-node:8.0.0
- During this workshop the following ports will be used:
8080
,8081
,3000
,3001
.
If they are not available on your machine, adjust the Docker CLI commands accordingly.
Since Docker leverages the Operating System's virtualization technologies, the install requirements for Docker are specific.
OS X requirements:
- 2010 or newer model with Intel's MMU virtualization
- OS X El Capitan 10.11 or newer
Windows requirements:
- 64-bit Windows
- Windows 10 Pro, Enterprise or Education (not Home, not Windows 7 or 8) to install Hyper-V
- Windows 10 Anniversary Update or better
- Access to your machine's BIOS to turn on virtualization
-
Run the script
npm run build
in order to build the 2 images for the frontend and the backend -
Run the script
npm run dev
in order to actually spin up the containers- Under the hood this script runs
docker-compose up frontend backend db redis
- Under the hood this script runs
- You will need to add a key and a certificate
- This can easily be done by using the following command:
go run $(go env GOROOT)/src/crypto/tls/generate_cert.go --host localhost
- This will add a
key.pem
andcert.pem
to the current directory - If running windows you should be able to the following command:
go run %go env GOROOT%/src/crypto/tls/generate_cert.go --host localhost
- Additionally you will have to update the http server in main.go
http.ListenAndServeTLS(":3001", "cert.pem", "key.pem", router)
Go to the gitbook Here