Skip to content

peterkracik/wp-gcloud-run

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 

Repository files navigation

Wordpress on Google Cloud Run

Build and deploy

gcloud builds submit --tag gcr.io/PROJECT_NAME/IMAGE_NAME // build an image
gcloud run deploy wordpress [--region REGION] --platform managed --image gcr.io/PROJECT_NAME/IMAGE_NAME --set-env-vars DB_NAME=wordpress,DB_USER=root,DB_PASSWORD=mysecretpassword,DB_HOST=database_host --port 80 // deploy to Cloud run

Environment variables and port could be set via Cloud Run interface, or pass it via yaml file as --env-vars-file .env.yaml https://cloud.google.com/functions/docs/env-var

Setup

  • Dockerfile contains oficial PHP image with Apache and configuration for mysql connect and image handling.
  • wp-config.php uses environment variables for database parameters instead of hard-coded values
  • contains WP-Stateless plugin, which allow us to use Google Cloud Storage instead of local storage

About

Setup to run Wordpress on Google Cloud Run

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published