I am learning docker, and my first step was to create a server with apache and php, and show a simple code; What I did was build my image with my docker file according to the following lines of code:
Start my container by creating an image in the folder in which the dockerfile and index.php file is located, using the following command:
docker build -y my-php-app
My Docker File
FROM php:7.2-apache
COPY . /var/www/html
My index.php:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<h1>Hola Mundo</h1>
<?php
echo '<p>Estoy Ejecutando mi primer contenedor en Docker</p>'
?>
</body>
</html>
Then run the docker run specifying the port where the host will listen (my localhost):
docker run -d -p 8080:80 – name my-prueba my-php-app
The error that throws me when I try to enter my container from another computer in my network
I raised my server with XAMPP and everything perfect, my network companions can reach you, but lifting it with docker can not.
Proxy is used in my company, and I already set it up but I don’t know if that can greatly influence