php:apache

From wikieduonline
Revision as of 14:05, 15 February 2024 by Welcome (talk | contribs) (→‎Dockerfile Working example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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: