Rodrigo Celebrone
Rodrigo Celebrone

Reputation: 346

How to setup docker-compose to work with app engine and wordpress?

I am using gitlab ci/cd to deploy my app to google app engine. I already have php instance working properly but when i try build wordpress image using docker-compose, nothing happen.

these are my files: enter image description here

enter image description here

enter image description here

enter image description here

I have a folder "web" with a files ping.php: https://site-dot-standalone-applications.appspot.com/ping.php

So application is running into /web folder.

wordpress should be deployed into /web folder after:

docker-compose up

UPDATE Just needed use the following gitlab-ci.yaml: enter image description here

Upvotes: 0

Views: 1084

Answers (1)

DazWilkin
DazWilkin

Reputation: 40306

Unfortunately, you cannot (easily) deploy containers to App Engine Flex this way.

At its simplest, App Engine Flex is a service that combines a load-balancer, an auto-scaler and your docker image. Your image when run as a container is expected to provide an HTTP/S endpoint on port 8080.

There are 2 ways that App Engine could support your deployment but it does neither:

  • It bundles a WordPress app image and a MySQL image into a single "pod" and exposes WordPress' HTTP port on :8080. This isn't what you want because then each WordPress instance has its own MySQL instance.

  • It separates the WordPress app into one service and the MySQL app into another service. This is closer to what you want as you could then scale the WordPress instances independently of the MySQL instances. However, databases are the definitive stateful app and you don't want to run these as App Engine services.

The second case suggests some alternative approaches for you to consider:

  1. Deploy your WordPress app to App Engine but use Google Cloud SQL service link.
  2. If you don't want to use Cloud SQL, you could run your MySQL database on Compute Engine link.
  3. You may wish to consider Kubernetes Engine. This would permit both the approaches outlined above and there are tools that help you migrate from docker-compose files to Kubernetes configurations link.

Since you're familiar with App Engine, I recommend you consider using option #1 above (Cloud SQL)

Upvotes: 1

Related Questions