-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy_local.sh
executable file
·25 lines (19 loc) · 1.41 KB
/
deploy_local.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
#!/usr/bin/env bash
# chmod 0777 ./deploy_local.sh
# if permission denied
# make sure that your ports 8082 (public-api), 8083 (game), 9090 (prometheus), 3000 (grafana) are open
# you will not be able to use prometheus or grafana localy with project configs; remove reverse proxy adaptation settings in
# prometheus and grafana configs or set up reverse proxy with the help of nginx.conf
# change manually your frontend origin in pkg/apps/game-serever/config.go and pkg/apps/public-api-server/config.go
# please do not rename directory of project, or you will have to change 2018_2_stacktivity_postgres_1
# to whatever your docker-compose will choose as the name of postgres container
sudo chmod 0777 ./make_bin.sh
./make_bin.sh
sudo docker-compose up -d
sudo docker cp storage/migrations/1_create_user_table.up.sql 2018_2_stacktivity_postgres_1:/var/
sudo docker cp storage/migrations/create_default_mult_levels.sql 2018_2_stacktivity_postgres_1:/var/
sudo docker cp storage/migrations/insert_levels.sql 2018_2_stacktivity_postgres_1:/var/
sudo docker exec 2018_2_stacktivity_postgres_1 useradd docker
sudo docker exec 2018_2_stacktivity_postgres_1 su docker -c "psql -d docker -a -f /var/1_create_user_table.up.sql"
sudo docker exec 2018_2_stacktivity_postgres_1 su docker -c "psql -d docker -a -f /var/create_default_mult_levels.sql"
sudo docker exec 2018_2_stacktivity_postgres_1 su docker -c "psql -d docker -a -f /var/insert_levels.sql"