Using Docker in PHP application

Creating docker file

$ touch Dockerfile
FROM php:8.0.15-cli
WORKDIR /var/www/html
COPY . /var/www/html
CMD ["php", "-S", "0.0.0.0:80"]

Building the Image

$ docker build -t docker-php .

Running the Container

$ docker run -p 8000:80 --name hello-php -d docker-php

--

--

--

Full-Stack Developer (Laravel, React, PHP, PostgreSQL)

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Automation Deletion Untagged Container Image in Amazon ECR Using ECR Lifecycle Policy

Python os.stat() Method with example

Gameplay Journal #5

Reduce Cost and Increase Productivity with Value Added IT Services from buzinessware — {link} -

Reduce Cost and Increase Productivity with Value Added IT Services from buzinessware — {link} -

Getting Started with Helm/Tiller in Kubernetes — Part Two

Infrastructure@Home: Infrastructure Management

AppMaster.io no-code platform updates | November 2021 | AppMaster.io

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ashok Gadri

Ashok Gadri

Full-Stack Developer (Laravel, React, PHP, PostgreSQL)

More from Medium

Laravel/PHP code coverage with GitHub Actions and Code Climate

Refactoring #3: Optimizing Eloquent queries & console commands

Laravel: Use Increment IDs , UUIDs, ULIDs as primary key or optional field for the Eloquent model

Configuring Laravel 7 For Use With PhpRedis using Homestead