Skip to content

Commit

Permalink
Merge pull request #124 from wayofdev/feat/2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lotyp authored Jun 1, 2024
2 parents 9781473 + f866f58 commit 21cec73
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 70 deletions.
51 changes: 0 additions & 51 deletions .github/workflows/ci.yml

This file was deleted.

15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ BUILDER_PARAMS ?= $(DOCKER) run --rm -i \
--env SHARED_DOMAIN_SEGMENT="$(SHARED_DOMAIN_SEGMENT)"

BUILDER ?= $(BUILDER_PARAMS) $(SUPPORT_IMAGE)
BUILDER_WIRED ?= $(BUILDER_PARAMS) --network project.$(COMPOSE_PROJECT_NAME) $(SUPPORT_IMAGE)
BUILDER_WIRED ?= $(BUILDER_PARAMS) --network network.$(COMPOSE_PROJECT_NAME) $(SUPPORT_IMAGE)

# Shorthand envsubst command, executed through build-deps
ENVSUBST ?= $(BUILDER) envsubst
Expand Down Expand Up @@ -110,13 +110,15 @@ PHONY: all
env: ## Generate .env file from example, use `make env force=true`, to force re-create file
ifeq ($(FORCE),true)
@echo "${YELLOW}Force re-creating .env file from example...${RST}"
$(ENVSUBST) $(EXPORT_VARS) < ./.env.example > ./.env
@# $(ENVSUBST) $(EXPORT_VARS) < ./.env.example > ./.env
cp ./.env.example ./.env
else ifneq ("$(wildcard ./.env)","")
@echo ""
@echo "${YELLOW}The .env file already exists! Use FORCE=true to re-create.${RST}"
else
@echo "Creating .env file from example"
$(ENVSUBST) $(EXPORT_VARS) < ./.env.example > ./.env
@# $(ENVSUBST) $(EXPORT_VARS) < ./.env.example > ./.env
cp ./.env.example ./.env
endif
.PHONY: env

Expand All @@ -133,7 +135,7 @@ cert-install: ## Run mkcert to install CA into system storage and generate defau
# Docker Actions
# ------------------------------------------------------------------------------------
up: ## Fire up project
$(DOCKER_COMPOSE) up --remove-orphans -d
$(DOCKER_COMPOSE) up --remove-orphans -d --wait
.PHONY: up

down: ## Stops and destroys running containers
Expand All @@ -160,10 +162,13 @@ pull: ## Pull upstream images, specified in docker-compose.yml file
.PHONY: pull

clean:
# $(DOCKER_COMPOSE) down -v
$(DOCKER_COMPOSE) rm --force --stop
.PHONY: clean

prune: ## Stops and removes all containers and volumes
$(DOCKER_COMPOSE) down --remove-orphans --volumes
.PHONY: prune

#
# Code Quality, Git, Linting
# ------------------------------------------------------------------------------------
Expand Down
38 changes: 24 additions & 14 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
---

version: '3.9'

services:
router:
image: traefik:v3.0.1
container_name: router
restart: on-failure
ports:
- "80:80"
- "443:443"
- '80:80'
- '443:443'
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik/conf/traefik.yml:/etc/traefik/traefik.yml
Expand All @@ -21,29 +19,35 @@ services:
- traefik.http.routers.router.entrypoints=websecure
- traefik.http.services.router.loadbalancer.server.port=8080
- traefik.http.routers.router.tls=true
healthcheck:
test: ['CMD-SHELL', 'traefik healthcheck --ping']
interval: 4s
timeout: 4s
retries: 8
start_period: 4s

ui:
image: portainer/portainer-ce:2.20.3-alpine
container_name: ui
restart: on-failure
ports:
- "9000"
- '9000'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ui_data:/data
command: "-H unix:///var/run/docker.sock"
command: '-H unix:///var/run/docker.sock'
labels:
- traefik.enable=true
- traefik.http.routers.ui.rule=Host(`ui${SHARED_DOMAIN_SEGMENT}.docker`)
- traefik.http.routers.ui.entrypoints=websecure
- traefik.http.services.ui.loadbalancer.server.port=9000
- traefik.http.routers.ui.tls=true
healthcheck:
test: "wget --no-verbose --tries=1 --spider --no-check-certificate http://localhost:9000 || exit 1"
interval: 60s
timeout: 5s
retries: 3
start_period: 20s
test: 'wget -q --no-verbose --tries=3 --spider --no-check-certificate http://127.0.0.1:9000/api/system/status || exit 1'
interval: 4s
timeout: 4s
retries: 8
start_period: 4s

dns:
image: drpsychick/dnsmasq:latest
Expand All @@ -52,17 +56,23 @@ services:
env_file:
- .env
ports:
- "53:53/tcp"
- "53:53/udp"
- '53:53/tcp'
- '53:53/udp'
cap_add:
- NET_ADMIN
healthcheck:
test: ['CMD-SHELL', 'nslookup localhost 127.0.0.1 || exit 1']
interval: 4s
timeout: 4s
retries: 8
start_period: 4s

networks:
default:
name: network.${COMPOSE_PROJECT_NAME}
ipam:
config:
- subnet: 172.100.61.1/24
- subnet: 172.100.61.0/24

volumes:
ui_data:
Expand Down
3 changes: 3 additions & 0 deletions traefik/conf/traefik.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,7 @@ tls:
certFile: /etc/traefik/cert.pem
keyFile: /etc/traefik/key.pem

ping:
entryPoint: 'web'

...

0 comments on commit 21cec73

Please sign in to comment.