This repository explores an application using docker, golang, and vuejs
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cypress Add cypress smoke test for application. Aug 12, 2018
handlers Make api more restful. Jan 14, 2018
images Push up repository assets for Modern Web Presentation. Jul 9, 2017
model Push up repository assets for Modern Web Presentation. Jul 9, 2017
redis Make api more restful. Jan 14, 2018
routes Make api more restful. Jan 14, 2018
src Make api more restful. Jan 14, 2018
test Add test for newer function. Jul 26, 2017
.bookignore Push up repository assets for Modern Web Presentation. Jul 9, 2017
.coveralls.yml Update coveralls token. Jul 12, 2017
.editorconfig Push up repository assets for Modern Web Presentation. Jul 9, 2017
.eslintignore Push up repository assets for Modern Web Presentation. Jul 9, 2017
.eslintrc.js Add eslint rules for cypress. May 20, 2018
.gitignore Add cypress smoke test for application. Aug 12, 2018
.travis.yml Changes to travis and update files. Jan 11, 2018
Dockerfile Add makefile and include changes for using dep golang dependency mana… Jan 11, 2018
Dockerfile-go Make api more restful. Jan 14, 2018
Gopkg.lock Fix issue with docker-compose. Jan 11, 2018
Gopkg.toml Add Gopkg toml file. Jan 11, 2018
LICENSE Push up repository assets for Modern Web Presentation. Jul 9, 2017
Makefile Make api more restful. Jan 14, 2018
README.md Add badges to README.md Jan 11, 2018
SUMMARY.md Push up repository assets for Modern Web Presentation. Jul 9, 2017
book.json Push up repository assets for Modern Web Presentation. Jul 9, 2017
books.json Changes for redigo and update references. Jul 19, 2017
cypress.json Add cypress e2e testing suite to application. May 15, 2018
data.go Add data.go to simplify main.go Jul 20, 2017
docker-compose.yml Fix issue with docker-compose. Jan 11, 2018
index.html Changes for redigo and update references. Jul 19, 2017
main.go Remove cert and key files. Jul 21, 2017
main_test.go Push up repository assets for Modern Web Presentation. Jul 9, 2017
package-lock.json Fix issue with docker-compose. Jan 11, 2018
package.json Add eslint rules for cypress. May 20, 2018
postcss.config.js Push up repository assets for Modern Web Presentation. Jul 9, 2017
webpack.config.js Changes for redigo and update references. Jul 19, 2017

README.md

Build Status Coverage Status

Containerized Golang and Vuejs applications

Sections:

Preparations:

  • 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

Assumptions:

  • 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.

Prerequisites

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

Install Docker

Docker Logo

Running the environment

  • 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

Setting up HTTPS for the Golang Server

  • 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 and cert.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)

Gitbook for Docker

Go to the gitbook Here