Go to file
jknapp b2b3d284a6 Merge pull request 'Streamline WordPress Setup' (#2) from add-script into trunk
Reviewed-on: #2
2024-01-31 00:44:15 +00:00
configs Some tuning of PHP and apache 2023-04-11 13:23:14 -07:00
pipeline automated pipeline to build images 2023-04-07 07:52:20 -07:00
scripts Updated to AlmaLinux 9 and reduced image size. Updated documentation to reflect move to ECR and changes 2023-05-27 11:13:18 -07:00
Dockerfile Updated to AlmaLinux 9 and reduced image size. Updated documentation to reflect move to ECR and changes 2023-05-27 11:13:18 -07:00
README.md Update Readme to reflect correction 2023-12-10 21:38:28 +00:00
local-dev.sh update script to setup the config 2024-01-30 16:40:42 -08:00

README.md

Cloud Apache Container

This is the base container for running PHP based applications. Select the PHP version environment variables. PHP Version Defaults to PHP 8.1

You mush have docker or compatable containerization software running.

You can pull this image locally by running:

docker pull public.ecr.aws/s1f6k4w4/cac:latest

You can then run a development version of the server by running the following commands: Note this is an example, you can modify the command(s) to fit your needs.

mkdir -p local-development/domain.tld
cd local-development/domain.tld
mkdir {web,db}
docker run -it -p 80:80 -p 443:443 -e PHPVER=81 -e environment=DEV --mount type=bind,source="$(pwd)"/web,target=/home/myuser/public_html --mount type=bind,source="$(pwd)"/db,target=/var/lib/mysql -e uid=30001 -e user=myuser -e domain=domain.tld -e serveralias=www.domain.tld --name local-dev  public.ecr.aws/s1f6k4w4/cac:latest

This will start the processes needed to run sites locally.

The first time you start the container, it will take some time as it is installing all the required software to run the dev instance.

If you need to get into the container you can run:

docker exec -it local-dev /bin/bash

To install WordPress for your site

cat /var/lib/mysql/creds
su - myuser
cd ~/public_html
wp core download

You should be able to then go into your browser and go to https://localhost (accept the SSL warning if it appears) and follow the prompts to setup the site.

The database credentials are shown in the /var/lib/mysql/creds file, which we had cat in the commands above.

PHPVER

74 - PHP 7.4
80 - PHP 8.0
81 - PHP 8.1
82 - PHP 8.2

Environment Variables

Required Tags
uid - User ID for File Permissions
user - Username for File Permissions
domain - Primary Domain for configuration

Optional Tags
environment - Set to DEV to start memcached and mysql locally for development purposes
serveralias - Set to allow alternative hostnames for a site. PHPVER - Set to use a different version of PHP refer to versions here.

Helpful Notes

  • On your first creation of a dev instance, you will be dumped to the logs output. Hit ctrl + c to exit the running process.
  • If you want to restart the instance again, run docker start {name-of-your-container} in the example, name-of-your-cintainer is local-dev
  • To stop a restarted instance, run docker stop {name-of-your-container}
  • To view log stream from container, run docker logs -f {name-of-your-container}
  • To delete a container, run docker rm {name-of-your-container} Note: this does not delete the files in public_html or database, as those are store in your system
  • To view running containers, run docker ps
  • To view all created containers, run ```docker ps --all``
  • To view all container images downloaded on your system, run docker images