Skip to content

Traefik + Portainer + Sonarqube docker based development environment

License

Notifications You must be signed in to change notification settings

neimheadh/development-kit

Repository files navigation

Neimheadh development kit

This repository contains a docker-based development environment. It gives to developers an ecosystem to their different projects container all the tools to develop web applications easily.

Included tools

All the following URL point to the different tools installed by the bin/setup script with the default configuration. If you changed the default configuration, or if you don't have installed the project yet, then the links will not work.

Dependencies

This development kit was build and tested on Linux environments. It should be not compatible for Windows or macOS.

To works, this development kit needs following commands to be installed in your computer:

Getting started

To install the development kit, just clone it anywhere on your computer:

git clone https://github.com/neimheadh/development-kit.git

Then execute the bin/setup script :

cd development-kit
bin/setup

And... That's all. The links in paragraph Included tools should now work.

Add your service

To add your service in traefik, just add it to the ${REVERSE_PROXY_NETWORK} network (see configuration below) and set labels traefik.enable and traefik.http.routers.{MY_SERVICE}.rule as following :

networks:
  front:
    external: true
    name: reverse-proxy

services:
  my_service:
    # [...]
    networks:
      - front
    labels:
      # Enable traefik resolve
      - traefik.enable=true
      # Set the service domain -- here my_service.docker.localhost
      - traefik.http.routers.my_service.rule=Host(`my_service.docker.localhost`)

If your service use multiple networks, you'll have to specify the network used by traefik with the label traefik.docker.network:

networks:
  back:
    driver: bridge
  front:
    # [...]

services:
  my_services:
    # [...]
    networks:
      - front
      - back
    labels:
      # [...]
      - traefik.docker.network=front

By default, all entrypoints are created in traefik for your service. If you only want some of them, you can set the traefik.http.routers.{MY_SERVICE}.entrypoints label like following:

# [...]
services:
  my_services:
    # [...]
    labels:
      # [...]
      - traefik.http.routers.ant_php.entryPoints=http,https

Configuration

On bin/setup execution, it creates a .env file from the .env.dist file with the changeable configuration variables. To change them you can edit a previously created .env file or copy the .env.dist file to a new .env file, change values and (re-)run bin/setup.

Here the list of changeable configuration variables:

variable default possible values definition
SERVICES  "traefik portainer sonarqube"  available space-separated service names in docker-compose.yml file Enabled development services
REVERSE_PROXY_NETWORK "reverse-proxy" any Docker network name used for the reverse-proxy (traefik)
BASE_DOMAIN "docker.localhost" any Base domain name for all your containers
PORTAINER_VERSION 1.23.2 A valid portainer image version The portainer image version for the portainer container
TRAEFIK_VERSION v2.2.1 A valid traefik image version The traefik image version for the traefik container
SONARQUBE_VERSION 8.3.1-community A valid sonarqube image version The traefik image version for the traefik container
TRAEFIK_SSL_CERT_FILE "./var/ssl/cert.pem" Any ssl cert file The SSL cert file used by traefik
TRAEFIK_SSL_KEY_FILE "./var/ssl/key.pem" Any ssl key file The SSL key file used by traefik

Here the list of configured traefik entrypoints:

 entrypoint  port  definition
http 80 Web
 https  443  Secured (SSL) web
 mysql 3306  MySQL database
 postgres 5432 Postgres database

Documentation

About

Traefik + Portainer + Sonarqube docker based development environment

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •