A sample project that runs phpBB forum on Apache web server using mySQL as the database server. Also includes phpmyadmin to view the database tables.
git clone https://github.com/parigandhi/forum.git docker-compose build --no-cache docker-compose up -d docker-compose down docker system prune -a chmod +x portainer.sh./portainer.sh 1. Create a GCP project.
2. Open the Cloud Console.
3. Clone the code
git clone https://github.com/parigandhi/forum.git 4. Go to the folder
cd forum5. Build an image Syntax:
gcloud builds submit --tag gcr.io/[project id]/[tag for the image]gcloud builds submit --tag gcr.io/my-docker-php-mysql/docker-gcp-tagGCP will ask you whether you want to enable the APIs. Select y to enable API
6. Verify that your image was successfully stored in GCP
Go to Storage > Storage > Browse
You will see two files - appspot.com and cloudbuild
appspot.com contains the container image and cloudbuild contains the source code as a tar file
7. Run the docker image on Google Cloud
Syntax:
gcloud run deploy --image gcr.io/[project id]/[tag for the image]gcloud run deploy --image gcr.io/my-docker-php-mysql/docker-gcp-tagGoogle will ask the target platform - Cloud Run (fully managed) - or - Cloud Run for Anthos deployed on Google Cloud-or- Cloud Run for Anthos deployed on VMWare
Select Cloud Run (fully managed)
Select enter to go with default service
Select y to enable API
Select a region to deploy the service
Select y to unauthenticated invocations
8. Once the service is published, Google Console will give you a URL to access the website. Click on it to launch your website.
Good luck