Sign inSign up

akester/php

By akester

•Updated about 18 hours ago

Container for running PHP-FPM in my opinionated K3's environment.

Image
0

10K+

akester/php repository overview

⁠PHP

This is a fairly opinionated PHP-FPM docker container that is built for my environment. It has a number of assumptions built in so I don't have to overwrite lots of code:

  • Everything runs as a user with a UID and GID of 5000
  • Logs go to /var/log/app
  • It's a small site, so only 10 workers are allowed max.
  • The app lives in /home/web/html

Each supported version of PHP is built, and they are all tagged as such, for example akester/php:8.4.

⁠SSH

These containers also are built in an SSH variant that includes all the usual PHP stuff and OpenSSH Server. The idea here is to give a shell for remote CI to connect to that has the same PHP Environment for automated code deployments, clearing caches, or manual troubleshooting.

To use one of those, use akester/php:8.4-ssh and provide a public key(s) that should be allowed in via the AUTHORIZED_KEY_FILE variable. This will be written to an authorized keys file for the non-root user to allow access. I recommend using some proxy in front of this set up, such as SSH Piper or the like.

These are kept in separate containers so that the main application container doesn't have the extra components installed and hopefully reduce any attack surface within the container.

⁠Building

This container is built using Packer. Running make will build all the images, or make build-all to build them all at the same time. You can also do make only-8.4 to build only version 8.4, for example.

The work in the container is done via Puppet. This is overkill, but simplifies a number of operations and ordering. Add things to the manifests to get them built in the containers.

Each version has a starter manifest, 8.4.pp and then calls a module to do the actual installation.

⁠Mirror

If you're looking at this repo at https://github.com/akester/php/⁠, know that it's a mirror of my local code repository. This repo is monitored though, so any pull requests or issues will be seen.

Tag summary

Content type

Image

Digest

sha256:82a1ff22f…

Size

227 MB

Last updated

about 18 hours ago

docker pull akester/php:8.1-ssh