intranet is a tool that let you deploy common enterprise services in an easy way. It includes:
- DNS (Bind9)
- Reverse proxy (NGINX)
- Site (NGINX)
- Storage (NGINX, File Browser)
- Mirrors (NGINX)
- Git (Gogs)
- CI (Drone)
- Container Registry (Docker Registry)
And will include (hopefully) soon:
- Services monitoring
- Proxy server
- VPN server
- CD
Requirements:
- GNU Make
- Docker >= 18.09
1. Setup the parameters.
$ EDITOR config.env
2. Initialize Swarm.
# docker swarm init
3. (Optional) Download the needed images.
# docker pull certbot/certbot
# docker pull drone/agent:0.8.6
# docker pull drone/cli:0.8.6
# docker pull drone/drone:0.8.6
# docker pull filebrowser/filebrowser:v2.0.3
# docker pull gogs/gogs:0.11.53
# docker pull ntrrg/bind:private
# docker pull ntrrg/htpasswd
# docker pull ntrrg/nginx:http
# docker pull ntrrg/nginx:rproxy
# docker pull registry:2
4. Generate secrets.
# make secrets
5. Deploy services.
# make
#
# # Run services in multiples nodes (see Services section)
# make deploy
#
# # Run services in one node
# make deploy-single
Constraints: node.role == manager
Ports: 53/tcp
, 53/upd
Domain | IP/Alias |
---|---|
example.com | 192.168.0.50 |
blog | example.com |
ci | example.com |
docker | example.com |
git | example.com |
home | example.com |
mirrors | example.com |
ns1 | example.com |
registry | example.com |
s6 | example.com |
status | example.com |
storage | example.com |
test | example.com |
www | example.com |
deb.debian.org
->mirrors.example.com
dl-cdn.alpinelinux.org
->mirrors.example.com
Constraints: node.role == manager
Ports: 80/tcp
, 443/tcp
Name | Protocol | Target |
---|---|---|
example.com | h2 |
site:80 |
blog.example.com | h2 |
site:80 |
ci.example.com | h2 |
ci-server:8000 |
docker.example.com | h2 |
docker-registry:5000 |
git.example.com | h2 |
git:3000 |
mirrors.web.ve | http , h2 |
mirrors:80 |
registry.web.ve | h2 |
registry:5000 |
status.web.ve | h2 |
status:8080 |
storage.web.ve | http , h2 |
storage:80 , filebrowser:80 |
www.example.com | h2 |
site:80 |
Constraints: node.role == manager
Constraints: node.labels.site == true
Constraints: node.labels.storage == true
Constraints: node.labels.mirrors == true
Constraints: node.labels.git == true
The easiest way to manage the Drone service is using the official CLI.
# docker run \
-e DRONE_SERVER=https://ci.example.com \
-e DRONE_TOKEN=TOKEN \
drone/cli:0.8.6 info
Note: TOKEN
should be obtained from the
web interface.
Also there are some useful endpoints for getting information about the CI services:
- https://ci.example.com/metrics
- https://ci.example.com/api/info/queue
- https://ci.example.com/api/builds
Constraints: node.labels.registry == true
Constraints: node.labels.docker-registry == true
Working on this project I use/used: