forked from n1215/roadrunner-docker-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtask
executable file
·72 lines (59 loc) · 974 Bytes
/
task
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
72
#!/usr/bin/env bash
# start containers
function up {
docker compose up -d $@
}
# stop containers
function down {
docker compose down
}
# initialize application
function init {
echo "Stating Initialization..."
echo "Copy .env file..."
cp -n .env.example .env
echo "Build docker images..."
docker compose build
echo "Install PHP dependencies..."
docker compose run roadrunner sh -c 'composer install'
echo "Initialization completed!"
}
# login to container
function login {
container=${1:-roadrunner}
echo "Attempt to login ${container} container..."
docker compose exec ${container} bash
}
# show container logs
function logs {
docker compose logs $1
}
# execute RoadRunner command
function rr {
docker compose exec roadrunner rr -c /etc/rr.yaml $1
}
subcommand=$1
shift
case $subcommand in
up)
up $@
;;
down)
down
;;
init)
init
;;
login)
login $1
;;
logs)
logs $1
;;
rr)
rr $1
;;
*)
echo "help"
;;
esac