Add Makefile and integrate with container registry

This commit is contained in:
Wojciech Kozlowski 2018-01-23 22:59:20 +00:00
parent eed6a2a0c9
commit 4f6c81da86
2 changed files with 170 additions and 7 deletions

163
Makefile Normal file
View File

@ -0,0 +1,163 @@
# -----------------------------------------------------------------------------
# The container registry to use.
# -----------------------------------------------------------------------------
DOCKER_REGISTRY = gitlab.wojciechkozlowski.eu:8443/wojtek/loki
# -----------------------------------------------------------------------------
# Default target.
# -----------------------------------------------------------------------------
default: all
# -----------------------------------------------------------------------------
# html
# -----------------------------------------------------------------------------
html-clean:
docker rmi $(DOCKER_REGISTRY)/html || /bin/true
html-build:
docker-compose build html
html-push:
docker-compose push html
html-pull:
docker-compose pull html
html: html-clean html-build html-push
# -----------------------------------------------------------------------------
# wiki
# -----------------------------------------------------------------------------
wiki-clean:
docker rmi $(DOCKER_REGISTRY)/wiki || /bin/true
wiki-build:
docker-compose build wiki
wiki-push:
docker-compose push wiki
wiki-pull:
docker-compose pull wiki
wiki: wiki-clean wiki-build wiki-push
# -----------------------------------------------------------------------------
# nextcloud-cron
# -----------------------------------------------------------------------------
nextcloud-cron-clean:
docker rmi $(DOCKER_REGISTRY)/nextcloud-cron || /bin/true
nextcloud-cron-build:
docker-compose build nextcloud-cron
nextcloud-cron-push:
docker-compose push nextcloud-cron
nextcloud-cron-pull:
docker-compose pull nextcloud-cron
nextcloud-cron: nextcloud-cron-clean nextcloud-cron-build nextcloud-cron-push
# -----------------------------------------------------------------------------
# gitlab
# -----------------------------------------------------------------------------
gitlab-clean:
docker rmi $(DOCKER_REGISTRY)/gitlab || /bin/true
gitlab-build:
docker-compose build gitlab
gitlab-push:
docker-compose push gitlab
gitlab-pull:
docker-compose pull gitlab
gitlab: gitlab-clean gitlab-build gitlab-push
# -----------------------------------------------------------------------------
# proxy
# -----------------------------------------------------------------------------
proxy-clean:
docker rmi $(DOCKER_REGISTRY)/proxy || /bin/true
proxy-build:
docker-compose build proxy
proxy-push:
docker-compose push proxy
proxy-pull:
docker-compose pull proxy
proxy: proxy-clean proxy-build proxy-push
# -----------------------------------------------------------------------------
# certbot
# -----------------------------------------------------------------------------
certbot-clean:
docker rmi $(DOCKER_REGISTRY)/certbot || /bin/true
certbot-build:
docker-compose build certbot
certbot-push:
docker-compose push certbot
certbot-pull:
docker-compose pull certbot
certbot: certbot-clean certbot-build certbot-push
# -----------------------------------------------------------------------------
# runner
# -----------------------------------------------------------------------------
runner-clean:
docker rmi $(DOCKER_REGISTRY)/runner || /bin/true
runner-build:
docker-compose build runner
runner-push:
docker-compose push runner
runner-pull:
docker-compose pull runner
runner: runner-clean runner-build runner-push
# -----------------------------------------------------------------------------
# Collect targets.
# -----------------------------------------------------------------------------
clean-all:
docker rmi $(shell docker images -q)
clean-builds: html-clean wiki-clean nextcloud-cron-clean gitlab-clean proxy-clean certbot-clean runner-clean
build-all:
docker-compose build
push-all:
docker-compose push
pull-all:
docker-compose pull
pull-builds: html-pull wiki-pull nextcloud-cron-pull gitlab-pull proxy-pull certbot-pull runner-pull
# -----------------------------------------------------------------------------
# Clean - build - push
# -----------------------------------------------------------------------------
all: clean-all build-all push-all

View File

@ -21,7 +21,7 @@ services:
html:
container_name: docker_html
build: html
image: html
image: gitlab.wojciechkozlowski.eu:8443/wojtek/loki/html
restart: always
# ---------------------------------------------------------------------------
@ -31,7 +31,7 @@ services:
wiki:
container_name: docker_wiki
build: dokuwiki
image: wiki
image: gitlab.wojciechkozlowski.eu:8443/wojtek/loki/wiki
volumes:
- vol_wiki:/var/dokuwiki-storage
restart: always
@ -64,7 +64,7 @@ services:
nextcloud-cron:
container_name: nextcloud_cron
build: nextcloud/cron
image: nextcloud-cron
image: gitlab.wojciechkozlowski.eu:8443/wojtek/loki/nextcloud-cron
volumes_from:
- nextcloud-app
restart: always
@ -87,7 +87,7 @@ services:
gitlab:
container_name: docker_gitlab
build: gitlab
image: gitlab
image: gitlab.wojciechkozlowski.eu:8443/wojtek/loki/gitlab
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://gitlab.wojciechkozlowski.eu'
@ -112,7 +112,7 @@ services:
proxy:
container_name: proxy
build: proxy
image: proxy
image: gitlab.wojciechkozlowski.eu:8443/wojtek/loki/proxy
ports:
- 80:80
- 443:443
@ -135,7 +135,7 @@ services:
certbot:
container_name: certbot
build: certbot
image: certbot
image: gitlab.wojciechkozlowski.eu:8443/wojtek/loki/certbot
volumes:
- vol_letsencrypt:/etc/letsencrypt
- vol_letsencrypt_html:/var/www/html
@ -148,7 +148,7 @@ services:
runner:
container_name: gitlab_runner
build: runner
image: runner
image: gitlab.wojciechkozlowski.eu:8443/wojtek/loki/runner
volumes:
- vol_etc_gitlab_runner:/etc/gitlab-runner
- vol_home_gitlab_runner:/home/gitlab-runner