README.md
Rendering markdown...
# Use the official WordPress 5.8 image with Apache
FROM wordpress:5.8-apache
# Set the working directory to the web root
WORKDIR /var/www/html
# Install dependencies for development and wp-cli
# sudo, less, and git are useful for dev work inside the container
RUN apt-get update && apt-get install -y \
less \
sudo \
git \
&& rm -rf /var/lib/apt/lists/*
# Install wp-cli (WordPress Command Line Interface)
RUN curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar \
&& chmod +x wp-cli.phar \
&& mv wp-cli.phar /usr/local/bin/wp
# The base image already exposes port 80, but we add it here for clarity.
# This is the port the Apache server inside the container will listen on.
EXPOSE 80