How to Dockerizing LEMP Stack with Docker-Compose
LEMP: Linux, Nginx, PHP, MySQL Nginx Create docker-compose.yml in a directory(lemp) is as follows: version: '3.8' services: nginx: image: nginx:1.20.2 ports: - 80:80 Let's test this out . $ docker-compose up -d The -d option indicates that run the containers in the background. It might take a little while as the Nginx image will first be downloaded from Docker Hub. When it is done, open localhost in your browser, which should display Nginx's welcome page: Welcome to nginx! If you see this page, the nginx web server is successfully installed and working. Further configuration is required. For online documentation and support please refer to nginx.org . Commercial support is available at nginx.com . Thank you for using nginx. To stop the container, simply run: $ docker-compose stop PHP Replace the content of docker-compose.yml with this one: version: '3.8' services: nginx: image: nginx:1.20.2 ports: - 80:80 volumes: