Difference between revisions of "Php:apache"

From wikieduonline
Jump to navigation Jump to search
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{lc}}
 
{{lc}}
 
 
 
  [[docker pull php:apache]]
 
  [[docker pull php:apache]]
 
  
 
  [[docker build . -t php-apache]]
 
  [[docker build . -t php-apache]]
 +
[[docker run -d]] --publish 80:80 --name php-apache php-apache
  
 +
== [[Dockerfile]] Working example ==
  
 +
{{php:apache Dockerfile}}
  
  FROM php:7.4-apache
+
== [[Bard]] example ==
 +
  [[FROM]] php:apache
 
   
 
   
 
  # Copy your PHP files to the document root
 
  # Copy your PHP files to the document root
  COPY . [[/var/www/html]]  
+
  [[COPY]] . [[/var/www/html]]  
 
   
 
   
 
  # Expose the web server port
 
  # Expose the web server port
Line 18: Line 19:
 
   
 
   
 
  # Start the Apache web server
 
  # Start the Apache web server
  CMD ["apache2", "-D", "FOREGROUND"]
+
  CMD ["[[apache2]]", "[[-D]]", "[[FOREGROUND]]"]
 
 
  
 
== See also ==
 
== See also ==
 +
* {{php:apache}}
 
* {{PHP}}
 
* {{PHP}}
  
 
[[Category:PHP]]
 
[[Category:PHP]]

Latest revision as of 14:05, 15 February 2024

docker pull php:apache
docker build . -t php-apache
docker run -d --publish 80:80 --name php-apache php-apache

Dockerfile Working example[edit]

 FROM php:apache

# Copy your PHP files to the document root
COPY index.php /var/www/html

# Expose the web server port
EXPOSE 80

Bard example[edit]

FROM php:apache

# Copy your PHP files to the document root
COPY . /var/www/html 

# Expose the web server port
EXPOSE 80 

# Start the Apache web server
CMD ["apache2", "-D", "FOREGROUND"]

See also[edit]

Advertising: