Re-using your examples

I have a Laravel (Boo! Hiss!) application that I’ve (rightly or wrongly) built as an image and pushed it to my ECR repo. I want to use your php-apache example to build my service on AWS. I’ve copied over the, package* and template file into my development directory/repo.

  1. Am I correct in assuming I “simply” need to change the default name for AppImage to my image and things will (mostly) work?

Edit: Apparently not. :slight_smile: I get a 503 when I do that.

  1. I don’t use nginx so that can be safely removed, right? Do I just delete any references or is there some complexity?

  2. In your examples, the DB username/password is hardcoded in the template file. I assume these and my Laravel .env files should be put into the Secrets service eventually, correct?

  3. More of a workflow question: If my developer builds a local instance, a MySQL database is spun up as well. I know how to have the DB initialized from a mysqldump file, but how are mysqldump files managed? They don’t go into the git repo or an image since there are passwords in there.

Hi @faberfedor
Thanks for posting your questions here!

  1. If your Laravel process listens on pot 80, yes (otherwise, modify AppPort in the template.yml file). You also want to modify HealthCheckPath: '/health-check.php' and point it to something your Laravel returns a 200 for.
  2. Why nginx? If you use the php-apache example there is no nginx?
  3. No, the password is not hardcoded. It is stored in Secrets Manager. The password is made available under the environment variable DATABASE_PASSWORD (see page 35…)
  4. RDS allows you to restore a database from a snapshot that is stored on AWS. Search for the AuroraServerlessCluster resource in template.yml and add an DBSnapshotIdentifier parameter to spin up an Aurora Cluster based on a snapshot. You can create the “initial” snapshot by performing a backup of your existing cluster. For the initial load of the first database, we show you how to set up phpmyadmin in the book (see page 70…)

I hope that helps

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.