Kitloft

All tools / Docker Compose examples

Apache HTTP Server with Docker Compose

Apache httpd serving files from a local folder.

Customize names, versions →

compose.yaml
services:
  apache:
    image: httpd:2.4
    restart: unless-stopped
    ports:
      - "8080:80"
    volumes:
      - ./htdocs:/usr/local/apache2/htdocs:ro

How to use it

Commands
docker compose up -d
docker compose ps
docker compose logs -f

Prefer Kubernetes? See the Apache HTTP Server Kubernetes version.