-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
devspace_start.sh
executable file
·67 lines (54 loc) · 1.79 KB
/
devspace_start.sh
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
#!/bin/bash
set +e # Continue on errors
install-php-extensions xdebug
echo "xdebug.mode = debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# Start Apache
apache2-foreground &
sleep 1
# Ensure file permissions
chown -R www-data:www-data .
export COMPOSER_ALLOW_SUPERUSER=1
if [ -f "composer.json" ]; then
echo "Installing PHP dependencies"
composer install \
--ignore-platform-reqs \
--no-interaction \
--no-plugins \
--no-scripts \
--prefer-dist
fi
export NODE_ENV=development
if [ -f "yarn.lock" ]; then
echo "Installing Yarn Dependencies"
yarn
else
if [ -f "package.json" ]; then
echo "Installing NPM Dependencies"
npm install
fi
fi
COLOR_BLUE="\033[0;94m"
COLOR_GREEN="\033[0;92m"
COLOR_RESET="\033[0m"
# Print useful output for user
echo -e "${COLOR_BLUE}
%########%
%###########% ____ _____
%#########% | _ \ ___ __ __ / ___/ ____ ____ ____ ___
%#########% | | | | / _ \\\\\ \ / / \___ \ | _ \ / _ | / __// _ \\
%#############% | |_| |( __/ \ V / ____) )| |_) )( (_| |( (__( __/
%#############% |____/ \___| \_/ \____/ | __/ \__,_| \___\\\\\___|
%###############% |_|
%###########%${COLOR_RESET}
Welcome to your development container!
This is how you can work with it:
- Files will be synchronized between your local machine and this container
- Some ports will be forwarded, so you can access this container via localhost
"
# Set terminal prompt
export PS1="\[${COLOR_BLUE}\]devspace\[${COLOR_RESET}\] ./\W \[${COLOR_BLUE}\]\\$\[${COLOR_RESET}\] "
if [ -z "$BASH" ]; then export PS1="$ "; fi
# Include project's bin/ folder in PATH
export PATH="./bin:$PATH"
# Open shell
exec bash --norc