Dockerfiles
Skeleton for a Docker nginx / php / mysql / redis development stack. Everything in its own container!
Install / Use
/learn @geerteltink/DockerfilesREADME
dockerfiles
A collection of customized containers for a Docker web development stack. Where possible the containers are build on top of Alpine Linux for a small footprint.
containers
- ghcr.io/geerteltink/nginx: latest
- ghcr.io/geerteltink/php: 8.0-cli, 8.0-fpm, 8.1-cli, 8.1-fpm, 8.2-cli, 8.2-fpm
- ghcr.io/geerteltink/mysql: latest
Usage
- Use a custom [docker compose.yml](docker compose.yml) file to do the work for you. Adjust the settings needed for the project.
- Copy
.env.distto.envand change at least the project id. - Start the container with
docker compose up -d.
- For consistency the source code lives in the
/appdir. - The app is available at http://localhost/.
- MailHog is used to catch emails and can be accessed at http://localhost:8025/.
Fixing "Permission Denied" Issues
Use setfacl to set permission on the host
sudo setfacl -Rm g:82:rwX,d:g:82:rwX /home/<username>/projects
Setup permissions for docker so the files can be accessed and deleted. The trick is to use the uid's from the docker processes. www-data/nginx: 82 - docker: 999 - mysql: 28
# Preserve default permissions for new files and folders
sudo setfacl -dR -m u:28:rwx -m u:82:rwx -m u:33:rwx -m u:999:rwx -m u:$(whoami):rwx data
# Set permissions
sudo setfacl -R -m u:28:rwx -m u:82:rwx -m u:33:rwx -m u:999:rwx -m u:$(whoami):rwx data
Xdebug
Xdebug is configured so it doesn't start automatically. You need to enable the debug listener in PhpStorm first and enable a session cookie in your Chrome or Firefox browser.
Building manually
docker build . --file Dockerfile --tag dev
docker run --rm -it tag
Docker commands
Start containers
docker compose up -d
Start and force rebuilding the containers
docker compose up --build
Stop containers
docker compose stop
Update containers
docker compose pull
Stream logs from all containers to the console
docker compose logs -t -f
Start a terminal for <container_name>
# With docker compose
docker compose run --rm php /bin/bash # Ubuntu/Debian based
docker compose run --rm php /bin/sh # Alpine Linux based
# With docker
docker exec -ti <container_name> /bin/bash # Ubuntu/Debian based
docker exec -ti <container_name> /bin/sh # Alpine Linux based
Docker maintenance commands
Stats for running containers
docker stats -a
Show used space, similar to the unix tool df
docker system df
Remove development junk: unused volumes, networks, exited containers and unused images
docker system prune --force --all
List all images
docker images
List containers
docker ps
Force stop all containers in PowerShell
docker ps -a -q | ForEach { docker stop $_ }
Related Skills
node-connect
339.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
prose
339.1kOpenProse VM skill pack. Activate on any `prose` command, .prose files, or OpenProse mentions; orchestrates multi-agent workflows.
frontend-design
83.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
sonoscli
339.1kControl Sonos speakers (discover/status/play/volume/group).
