-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (52 loc) · 1.8 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!make
include .env
export $(shell sed 's/=.*//' .env)
SNAPSHOT ?= latest
all: precheck volume up
.PHONY: log
precheck:
@if [ ! -f "./.env" ]; then echo "⚠️ .env doesn't exists."; exit 1; fi
canrun: precheck
@if [ ! -f "./configs/php-fpm.d/zz-docker.conf" ]; then echo "⚠️ Missing configuration, run make config"; exit 1; fi
@if [ ! -f "./configs/mail/helo_access" ]; then echo "⚠️ Missing configuration, run make config"; exit 1; fi
@if [ ! -f "./configs/nginx/conf.d/default.conf" ]; then echo "⚠️ Missing configuration, run make config"; exit 1; fi
volume: canrun
docker volume create ${DBNAME}-volume
cleanup: down
docker volume rm ${DBNAME}-volume || true
@./bin/lib/installmariadb
up: canrun
docker-compose up -d
down:
docker-compose down
update:
docker-compose pull
docker-compose down
docker-compose up -d
restart: down up
restore: down
@chmod +x ./bin/install*
@./bin/installfullrestore
restoredb: down cleanup all
@echo "🧭 Waiting 20s for DB to be ready"
@sleep 20
@docker exec ${DBNAME} bash -c "/var/www/database/restore"
@docker restart ${DBNAME}
snapshot:
docker exec ${NAME}-cronjob bash -c "/usr/cbin/restics3backup user"
logs:
docker-compose logs --follow
config: SHELL:=/bin/bash
config: precheck
@ufw allow from any to any proto tcp port 7844 comment "Cloudfalre ZeroTrust Tunnels tcp/7844"
@ufw allow from any to any proto udp port 7844 comment "Cloudfalre ZeroTrust Tunnels udp/7844"
@chmod +x ./bin/install*
@./bin/installstructure
teleport: snapshot
@chmod +x ./bin/install*
@./bin/installteleport
teleport-all: teleport
@cp -pr .git ./teleport/${COMPOSE_PROJECT_NAME}/.git
@cp -pr .gitignore ./teleport/${COMPOSE_PROJECT_NAME}/
@rm -rf ./teleport/${COMPOSE_PROJECT_NAME}.tar.gz
@tar -czf ./teleport/${COMPOSE_PROJECT_NAME}/html.tar.gz ./html