-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
56 lines (44 loc) · 1.59 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
up:
docker compose up -d --remove-orphans
upb:
docker compose up -d --build --remove-orphans
stop:
docker compose stop
st: stop
ps:
docker compose ps
#make logs name=php-83
logs:
docker compose logs --tail=100 -f $(name) || true
nlogs:
docker compose logs --tail=100 -f nginx || true
dblogs:
docker compose logs --tail=100 -f db || true
#make rs name=php-83
rs:
docker compose restart $(name)
nrs:
docker compose restart nginx
#make exec name=php-83
exec:
docker compose exec $(name) /bin/sh || true
ex: exec
# exec shell in first matched php container
php:
docker compose exec `docker compose ps --services | grep -m 1 'php-'` /bin/sh -c 'cd /srv/projects; if grep -q "/ash" /etc/shells; then exec /bin/ash; else exec /bin/sh; fi' || true
# ---------------------------
# RUN
#make ssl d="site.ru,www.site.ru"
ssl:
docker compose -f docker-compose.acme.yml run --rm acme acme.sh --issue -d `echo $(d) | sed 's/,/ \-d /g'` -w /acme-challenge
acme:
docker compose -f docker-compose.acme.yml run --rm acme acme.sh
node:
docker compose -f docker-compose.node.yml run --rm node /bin/sh -c 'cd /srv/projects; exec /bin/ash' || true
#make mysqltuner mem=4096
mysqltuner:
docker compose -f docker-compose.mysqltuner.yml run --rm mysqltuner /bin/ash -c "/opt/mysqltuner --user root --host db --pass \$$MYSQL_ROOT_PASSWORD --forcemem $(mem)" || true
mycli:
docker compose -f docker-compose.mycli.yml run --rm mycli /bin/ash -c "mycli -uroot -hdb -p\$$MYSQL_ROOT_PASSWORD" || true
mysql:
docker compose -f docker-compose.mysqltuner.yml run --rm mysqltuner /bin/sh -c 'cd /srv/projects/; exec /bin/ash' || true