One page website boilerplate with Bootstrap 4, webpack-dev-server and Docker
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE
config
img
infra
src
.eslintrc.yml
.gitignore
.html-linter.json
.sass-lint.yml
.travis.yml
Dockerfile
Dockerfile.dev
README.md
docker-compose.dev.yml
docker-compose.infra.yml
docker-compose.yml
package-lock.json
package.json
postcss.config.js
webpack.config.js

README.md

One page website with Bootstrap 4, webpack-dev-server and Docker

This repository is a learning example and a simple boilerplate for a one page website using Bootstrap 4, webpack-dev-server and Docker.

Preview gif

Info

Build Status dependencies Status devDependencies Status License: MIT

Usage

You can start the project in production mode and development mode.

Development mode

To serve the project with webpack-dev-server use the command:

docker-compose -f docker-compose.dev.yml up -d

In oder to build the development Docker image separately, use the command:

docker-compose -f docker-compose.dev.yml build

Production mode

To serve the project in production mode use the command:

docker-compose up -d

Features

Development mode is set up to provide the following key features:

  • hot reloading of js changes
  • hot reloading of scss changes
  • hot reloading of index.html template changes

Production mode features a multi-stage Docker build to minimize image size.

Infrastructure as code

Terraform

The repo contains a working example to create an AWS EC2 t2.micro instance automatically with Terraform.

First create a file called terraform.tfwars under the infra directory. I have provided an example, so you can just rename terraform.example.tfvars and fill in your AWS secret credentials in the file.

Update docker-compose.infra.yml and update the keypair path information on your machine.

Then run the following commands:

$ docker-compose -f docker-compose.infra.yml run --rm terraform init
$ docker-compose -f docker-compose.infra.yml run --rm terraform plan
$ docker-compose -f docker-compose.infra.yml run --rm terraform apply -auto-approve

Credits

Site theme design greatly inspired by this repo: https://github.com/BlackrockDigital/startbootstrap-creative.