- Many introductory articles are available online. I found these three particularly beginner-friendly:
Docker Tutorial Series from Basics to Advanced
Docker Tutorial Series (2): Docker Build
Docker Tutorial Series (3): Docker-Compose
Docker
- You can directly pull an image using the command (take
nginx
as an example):docker pull nginx
Dockerfile
- Essentially a text file describing how an image is built.
- After writing a
Dockerfile
, executedocker build
to construct the image based on the instructions. - Built images can be pushed to repositories, with Docker Hub being the most commonly used official repository.
Docker Compose
- Docker prefers splitting services into separate containers for easier management and partial rebuilding when environments change (compared to bundling everything in a single container).
First Steps
- Run
docker pull php-fpm
, then execute commands likeapt
anddocker-php-ext-enable
directly in the container. - Note: The
php-fpm
image is built on Ubuntu. Check itsDockerfile
to see available commands.
LaraDock Pitfalls and Solutions
- The
php-worker
container cannot write logs directly to the project. Consider using Redis instead.
Configuring Supervisor in laradock with php-worker
- The php-worker container doesn’t have bash access (unlike other containers).
- Supervisord automatically keeps processes alive based on configurations when the php-worker container starts.
- After modifying supervisord configurations, rebuild the container:
docker-compose build php-worker && docker-compose up -d php-worker
- If using Redis as the queue driver, install it in the php-worker container by setting
.env
:PHP_WORKER_INSTALL_REDIS=true