I searched thoroughly and could not find any info on this issue.
Currently, I am building a Word Press site, hosted on Google Cloud's Compute Engine. The goal is to build an autoscaling WP site. I am currently attempting to build the instance template, which I can then use to deploy an instance group and subsequently setup the HTTP load balancer.
I am using a base Ubuntu 16.04 image, and from there I installed the rest of the LEMP stack.
I was successfully able to use the SQL proxy to connect to Cloud SQL so that all of the ephermal instances to be deployed will share the same database. To have the proxy initiated each time a new instance is spun up, I am using a startup script:
./cloud_sql_proxy -dir=/cloudsql &
But here's my issue right now: the Word Press files. I can't figure out a way to have all of the instances use the same WP files. I already tried to use Google Cloud Storage FUSE, but when I mount the bucket at the root directory, it deletes all of the WordPress folders (wp-content, wp-admin, wp-includes).
It's as if the instance can't "see" the folders I have in the google cloud storage. Here was my work flow:
- setup LEMP with WordPress--got the site working on the front end--all systems go
copied all of the files/folders in my root directory (/var/www/html/) to google cloud bucket
gsutil -m cp -r /var/www/html/. gs://example-bucket/
Then I mounted the bucket at my directory
gcsfuse --dir-mode "777" -o allow_other example-bucket /var/www/html/
But now, when I "ls" inside of the root directory from the Linux terminal, I DON'T see any of the WP folders (wp-includes, wp-admin, wp-content).
My end goal is to have a startup script that:
- initiates the DB proxy so all WP instances can share the same DC
- initiates the mounting of the google cloud bucket so all instances can share the same WP files
Obviously, that isn't working right now.
What is going wrong here? I am also open to other ideas for how to make the WP files "persistent" and "shared" across all of the ephemeral instances that the instance group spins up.