✋✋✋Hello everyone, welcome back to Learn Tech Tips Blogspot. I am Zidane (大家好, 我是雞蛋🥚🥚)
Nice to meet you back. Today I will show you How to create a Dockerfile and Docker Compose for PHP8 Service, so you can start server no need download any MAMP, WAMP, nginx …
Wow, That sound good, I no need to download any heavy things just want to run a small php 8 (include server inside). Ok let discovery now.
As you know when you working with Docker, you should know what is Docker?
If you are new in docker you can check below information.
👇
“Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. The service has both free and premium tiers. The software that hosts the containers is called Docker Engine. It was first started in 2013 and is developed by Docker, Inc”
If you already know docker, you can go through this topic right now.
👉 Tiktok
👉 Facebook:
Ok. Let’s back to topic
How to create a Dockerfile and Docker Compose for PHP8 Service – without setup any MAMP, XAMP, nginx
Docker container is a unit of software that packages up code and all its dependencies to allow the application to tun quickly and reliably from one computing environment to another. For laynching multiple docker containers, a YAML file is used by compose to initialize services for the app. Creating and lauching all of the functions is as simple as issuing a single command when configutation is complete
Ok. Let’s create a Dockerfile first with below command
On above command, we have php/custome_config.ini for easy config later, so we need create a folder structure like this
custom_config.ini with below info
After that, create docker compose with below
networks:
default:
name: learntechtips-network
services:
app:
container_name: serverphp8
image: serverphp8
ports:
– 8080:80
volumes:
– ./:/var/www/html:delegated
If you still cannot catch up me on this topic, you can access to my github for checkout the docker file and docker compose for php8 service 👉 here