Difference between revisions of "Php:apache"

From wikieduonline
Jump to navigation Jump to search
Line 3: Line 3:
  
 
  [[docker build . -t php-apache]]
 
  [[docker build . -t php-apache]]
 +
  docker run --publish 80:80 --name zumo-app  -d zumo-app
  
 
== [[Dockerfile]] Working example ==
 
== [[Dockerfile]] Working example ==
Line 8: Line 9:
 
   
 
   
 
  # Copy your PHP files to the document root
 
  # Copy your PHP files to the document root
  COPY . /var/www/html
+
  [[COPY]] index.php /var/www/html
 
   
 
   
 
  # Expose the web server port
 
  # Expose the web server port

Revision as of 13:58, 15 February 2024

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

Dockerfile Working example

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

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

Advertising: