Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
This branch is 1 commit behind colli181:main.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Template for building PHP based CTF

Various docker file and docker-compose to bring everything together Lets us the classic LAMP stack:

  • Apache / PHP
  • MySQL


We have two ways of working with this.

  • Development mode: Lets is work with a "Live" version of the site
  • Deploy Mode: "Bakes" the site into a single image.

I tend to work with the development version, as it lets me bugger around and get everything setup.

When its time to deploy, I then build a deploy version, with the content "baked" into the image. This means that we have our final cut of the machine can be recreated at any time.

Compose Files

We can start things up with the docker-compose files. This will build a "stack" of docker images, with PHP and mySQL. Items in the stack are segregated from the base OS, bt can talk to each other, like they are on the same machine.

  • devel-compose.yaml Development version, use this for testing.

  • deploy-compose.yaml The Deploy version of the site. I would rename this to docker-compose when you are ready to go

Working with It.

For development start the version

docker-compose -f devel-compose up

For deploy you need to

docker-compose -f deploy-compose build
docker-compose -f deploy-compose up


When it comes to deploy time (or for convenience) you might want to link the version you are working with to be called docker-compose This lets you start and stop the service without specifing the compose file

For example you can do this to work with the development version by defaul

ln -s devel-compose.yaml docker-compose.yaml
#Then start with 
docker-compose up


The PHP stuff live in PHP/content use this as the equivilent of the /var/www/html

  • I have stuck an index.php file in there,
  • conn.php is giving an example of connecting to the database


No description, website, or topics provided.






No releases published


  • PHP 73.0%
  • Hack 19.7%
  • CSS 3.6%
  • JavaScript 2.3%
  • Dockerfile 1.4%