Skip to content

CodeBarbarian/docker-boilerplates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Docker Boilerplates

Easy to use boilerplates for self-hosting and development
Explore the docs »

· Report Bug · Request help or features

Table of Contents
  1. About The Project
  2. Still needs doing
  3. Getting Started
  4. License
  5. Contact
  6. Acknowledgments

About The Project

Who does not love boilerplates? This will be the project where I collect and publish all kinds of boilerplates. My main focus for this project will be on providing good documentation and tested docker configurations for rapid deployment and development.

(back to top)

Still needs doing

Unsure...

Maybe even try to get done with the syntax folder, adding helpful tips and tricks for future use

Getting Started

Download project, go into directory for what you would like to run and issue:

docker-compose up -d

Prerequisites

  • Docker
  • Docker Compose

Reverse Proxy Server with Traefik

This allows you to use Traefik as your Reverse Proxy. This also adds the certificate from the certificate resolver you want. in this case production.

  • Production = Lets Encrypt Production
  • Staging = Lets Encrypt Staging
  • Cloudflare = Cloudflare
labels:
  - "traefik.enable=true"
  - "traefik.http.routers.your-router-name.entrypoints=web, websecure"
  - "traefik.http.routers.your-router-name.rule=Host(`servicename.example.com`)"
  - "traefik.http.routers.your-router-name.tls=true"
  - "traefik.http.routers.your-router-name.tls.certresolver=production"

To get everything working it also needs to be on the same network as traefik is controlling. This needs to be added to the services as well, I usually put it on the bottom of the docker-compose.yml file.

networks:
  - web

networks:
  web:
    external: true

Adding SSL certificates to local environment

Add this to the labels for the traefik container

labels:
  - "traefik.enable=true"
  - "traefik.http.routers.traefik.entrypoints=web"
  - "traefik.http.routers.traefik.rule=Host(`traefik-dashboard-internal.local.example.com`)"
  - "traefik.http.middlewares.sslheader.headers.customrequestheaders.X-Forwarded-Proto=https"
  - "traefik.http.routers.traefik-secure.entrypoints=websecure"
  - "traefik.http.routers.traefik-secure.rule=Host(`traefik-dashboard-internal.local.example.com`)"
  - "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
  - "traefik.http.routers.traefik-secure.tls=true"
  - "traefik.http.routers.traefik-secure.tls.certresolver=cloudflare"
  - "traefik.http.routers.traefik-secure.tls.domains[0].main=local.example.com"
  - "traefik.http.routers.traefik-secure.tls.domains[0].sans=*.local.example.com"
  - "traefik.http.routers.traefik-secure.service=api@internal"

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Morten Haugstad - @codebarbarian

Project Link: https://github.com/codebarbarian/docker-boilerplates

(back to top)

Acknowledgments

(back to top)

About

Easy to use boilerplates for self-hosting and development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published