-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.sh
executable file
·47 lines (30 loc) · 948 Bytes
/
setup.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
#!/bin/bash
# Only execute this script on a new deployment
# create environment file
cp galeno-app/.env.example galeno-app/.env
# build the containers
docker-compose build
# run composer install
./composer-install.sh
# create docker secret
# and place db password in env file
mkdir secrets
openssl rand -base64 48 | tee secrets/db_root_password
sed -i -e 's|/||g' 'secrets/db_root_password'
rm secrets/db_root_password-e
DBPASSWORDLINE="DB_PASSWORD=$(cat secrets/db_root_password)"
echo $DBPASSWORDLINE
sed -i -e "s/DB_PASSWORD=/$DBPASSWORDLINE/g" 'galeno-app/.env'
rm galeno-app/.env-e
# bring up containers
docker-compose up -d
# generate application key
docker-compose exec php php artisan key:generate
# chown the web files
docker-compose exec php chown -R www-data:www-data /var/www/html
#install npm modules
cd galeno-app
npm install
npm run production
# migrate db
docker-compose exec php php artisan migrate:refresh --seed