-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_laravel_instance.sh
More file actions
executable file
·42 lines (32 loc) · 1.14 KB
/
create_laravel_instance.sh
File metadata and controls
executable file
·42 lines (32 loc) · 1.14 KB
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
#!/usr/bin/sh
# Script is retrieved from https://laravel.build/laravel-workshop-blog
docker info > /dev/null 2>&1
# Ensure that Docker is running...
if [ $? -ne 0 ]; then
echo "Docker is not running."
exit 1
fi
docker run --rm \
--pull=always \
-v "$(pwd)":/opt \
-w /opt \
laravelsail/php82-composer:latest \
bash -c "laravel new laravel-workshop-blog && cd laravel-workshop-blog && php ./artisan sail:install --with=mysql,redis,meilisearch,mailpit,selenium "
cd laravel-workshop-blog
./vendor/bin/sail pull mysql redis meilisearch mailpit selenium
./vendor/bin/sail build
CYAN='\033[0;36m'
LIGHT_CYAN='\033[1;36m'
BOLD='\033[1m'
NC='\033[0m'
echo ""
if sudo -n true 2>/dev/null; then
sudo chown -R $USER: .
echo -e "${BOLD}Get started with:${NC} cd laravel-workshop-blog && ./vendor/bin/sail up"
else
echo -e "${BOLD}Please provide your password so we can make some final adjustments to your application's permissions.${NC}"
echo ""
sudo chown -R $USER: .
echo ""
echo -e "${BOLD}Thank you! We hope you build something incredible. Dive in with:${NC} cd laravel-workshop-blog && ./vendor/bin/sail up"
fi