- Draft
- About this project
- Makefile
- PHP Container (More details are explained in the point 2.2)
- PHPmyAdmin Container -> Link to Docker Hub -> PHPmyAdmin
- MariaDB Container -> Link to Docker Hub -> MariaDB
With the From command we use a base image to set up our own image later on
From php:8.0.18-apache
With the command WORKDIR it should go into the directory /var/www/html
WORKDIR /var/www/html
Now with the copy command it should copy over from the local src folder to the Docker host
COPY ./src/ /var/www/html
With the RUN command it should install updates and software.
RUN apt-get update && apt-get install -y\
vim
...
..
.
A Makefile is there to tell the make program what to do, for example to start or stop the Docker container.
More details are given in the table.
Important!!! If necessary insert a sudo command before make
Command | background execution command | Description |
---|---|---|
make build | docker-compose build | Build the image |
make up | docker-compose up -d | Build and run the image |
make up_attached | docker-compose up | Bild and run the container, but keep attached |
make down | docker-compose down | Stop the container. Removes attached volumes |
make logs | docker-compose logs -f | Attach to container logs |
make restart | docker-compose restart | Restart the container |
make delete | docker image prune -a && docker image ls | All images will be deleted and after that all images should be listed |
make version | docker-compose --version; docker --version | Show version of Docker-compose and Docker |