Skip to content

Commit 21cec73

Browse files
authored
Merge pull request #124 from wayofdev/feat/2.0
2 parents 9781473 + f866f58 commit 21cec73

File tree

4 files changed

+37
-70
lines changed

4 files changed

+37
-70
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

Makefile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ BUILDER_PARAMS ?= $(DOCKER) run --rm -i \
2424
--env SHARED_DOMAIN_SEGMENT="$(SHARED_DOMAIN_SEGMENT)"
2525

2626
BUILDER ?= $(BUILDER_PARAMS) $(SUPPORT_IMAGE)
27-
BUILDER_WIRED ?= $(BUILDER_PARAMS) --network project.$(COMPOSE_PROJECT_NAME) $(SUPPORT_IMAGE)
27+
BUILDER_WIRED ?= $(BUILDER_PARAMS) --network network.$(COMPOSE_PROJECT_NAME) $(SUPPORT_IMAGE)
2828

2929
# Shorthand envsubst command, executed through build-deps
3030
ENVSUBST ?= $(BUILDER) envsubst
@@ -110,13 +110,15 @@ PHONY: all
110110
env: ## Generate .env file from example, use `make env force=true`, to force re-create file
111111
ifeq ($(FORCE),true)
112112
@echo "${YELLOW}Force re-creating .env file from example...${RST}"
113-
$(ENVSUBST) $(EXPORT_VARS) < ./.env.example > ./.env
113+
@# $(ENVSUBST) $(EXPORT_VARS) < ./.env.example > ./.env
114+
cp ./.env.example ./.env
114115
else ifneq ("$(wildcard ./.env)","")
115116
@echo ""
116117
@echo "${YELLOW}The .env file already exists! Use FORCE=true to re-create.${RST}"
117118
else
118119
@echo "Creating .env file from example"
119-
$(ENVSUBST) $(EXPORT_VARS) < ./.env.example > ./.env
120+
@# $(ENVSUBST) $(EXPORT_VARS) < ./.env.example > ./.env
121+
cp ./.env.example ./.env
120122
endif
121123
.PHONY: env
122124

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

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

162164
clean:
163-
# $(DOCKER_COMPOSE) down -v
164165
$(DOCKER_COMPOSE) rm --force --stop
165166
.PHONY: clean
166167

168+
prune: ## Stops and removes all containers and volumes
169+
$(DOCKER_COMPOSE) down --remove-orphans --volumes
170+
.PHONY: prune
171+
167172
#
168173
# Code Quality, Git, Linting
169174
# ------------------------------------------------------------------------------------

docker-compose.yaml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
---
22

3-
version: '3.9'
4-
53
services:
64
router:
75
image: traefik:v3.0.1
86
container_name: router
97
restart: on-failure
108
ports:
11-
- "80:80"
12-
- "443:443"
9+
- '80:80'
10+
- '443:443'
1311
volumes:
1412
- /var/run/docker.sock:/var/run/docker.sock:ro
1513
- ./traefik/conf/traefik.yml:/etc/traefik/traefik.yml
@@ -21,29 +19,35 @@ services:
2119
- traefik.http.routers.router.entrypoints=websecure
2220
- traefik.http.services.router.loadbalancer.server.port=8080
2321
- traefik.http.routers.router.tls=true
22+
healthcheck:
23+
test: ['CMD-SHELL', 'traefik healthcheck --ping']
24+
interval: 4s
25+
timeout: 4s
26+
retries: 8
27+
start_period: 4s
2428

2529
ui:
2630
image: portainer/portainer-ce:2.20.3-alpine
2731
container_name: ui
2832
restart: on-failure
2933
ports:
30-
- "9000"
34+
- '9000'
3135
volumes:
3236
- /var/run/docker.sock:/var/run/docker.sock
3337
- ui_data:/data
34-
command: "-H unix:///var/run/docker.sock"
38+
command: '-H unix:///var/run/docker.sock'
3539
labels:
3640
- traefik.enable=true
3741
- traefik.http.routers.ui.rule=Host(`ui${SHARED_DOMAIN_SEGMENT}.docker`)
3842
- traefik.http.routers.ui.entrypoints=websecure
3943
- traefik.http.services.ui.loadbalancer.server.port=9000
4044
- traefik.http.routers.ui.tls=true
4145
healthcheck:
42-
test: "wget --no-verbose --tries=1 --spider --no-check-certificate http://localhost:9000 || exit 1"
43-
interval: 60s
44-
timeout: 5s
45-
retries: 3
46-
start_period: 20s
46+
test: 'wget -q --no-verbose --tries=3 --spider --no-check-certificate http://127.0.0.1:9000/api/system/status || exit 1'
47+
interval: 4s
48+
timeout: 4s
49+
retries: 8
50+
start_period: 4s
4751

4852
dns:
4953
image: drpsychick/dnsmasq:latest
@@ -52,17 +56,23 @@ services:
5256
env_file:
5357
- .env
5458
ports:
55-
- "53:53/tcp"
56-
- "53:53/udp"
59+
- '53:53/tcp'
60+
- '53:53/udp'
5761
cap_add:
5862
- NET_ADMIN
63+
healthcheck:
64+
test: ['CMD-SHELL', 'nslookup localhost 127.0.0.1 || exit 1']
65+
interval: 4s
66+
timeout: 4s
67+
retries: 8
68+
start_period: 4s
5969

6070
networks:
6171
default:
6272
name: network.${COMPOSE_PROJECT_NAME}
6373
ipam:
6474
config:
65-
- subnet: 172.100.61.1/24
75+
- subnet: 172.100.61.0/24
6676

6777
volumes:
6878
ui_data:

traefik/conf/traefik.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,7 @@ tls:
3939
certFile: /etc/traefik/cert.pem
4040
keyFile: /etc/traefik/key.pem
4141

42+
ping:
43+
entryPoint: 'web'
44+
4245
...

0 commit comments

Comments
 (0)