Skip to content

Instantly share code, notes, and snippets.

@elminson
Last active December 14, 2023 09:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elminson/837a26806fe244eb4ba59fbe6f417ac6 to your computer and use it in GitHub Desktop.
Save elminson/837a26806fe244eb4ba59fbe6f417ac6 to your computer and use it in GitHub Desktop.

Commands to deploy Laravel API App in GCP

in the console after deploy LAMP Certified by Bitnami

Install the project

cd /opt/bitnami/apache2/htdocs

sudo git clone https://github.com/elminson/gc_lamp_laravel.git todo

cd todo

sudo composer install

sudo chmod 777 storage/* -R

Configure the project

Enter in Mysql console:

mysql -u root -p

and execute this command:

create database apiDB;

and exit from the mysql console

Create a copy of .env.example with this command

sudo cp /opt/bitnami/apache2/htdocs/todo/.env.example /opt/bitnami/apache2/htdocs/todo/.env

Edit the file .env to set the database name and password

sudo vim /opt/bitnami/apache2/htdocs/todo/.env

And change this line

DB_HOST=127.0.0.1
DB_DATABASE= 
DB_PASSWORD=

for

DB_HOST=localhost
DB_DATABASE=apiDB 
DB_PASSWORD=aSuperPasswordWithSteroids 

Finally execute

php artisan migrate

To load test data

php artisan db:seed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment