I’m just starting out with Docker, on my first example project, and I’ve run into a problem that’s resisted me for the last hour. I’m on Fedora Workstation 38; Docker v24.0.2, build cb74dfc; Docker Compose v2.18.1; Docker Desktop v4.20.0. To begin, I’m just trying to get Apache up on my localhost, serving files from a host directory. The tutorial I’m using starts me out with docker compose
:
# docker-compose.yaml
version: '3.8'
services:
apache:
image: httpd:2.4
container_name: apache
ports:
- 80:80
- 443:443
volumes:
- /home/dan/Projects/web/docker-experiment/public_html/:/usr/local/apache2/htdocs/
After docker compose up -d
, everything seems to work. Apache is accessible in the browser, and Docker Desktop’s dashboard reads all green.
But Apache isn’t picking up the files in my host’s public_html
directory. When I inspect the apache
service in Desktop, the correct absolute path is listed. But when I use Desktop’s terminal or file browser to list the contents of htdocs
, it’s empty. No error messages appear in Desktop’s logs.
It’s unclear to me what I should do next. I hope I’ve provided enough information, but if not I’m happy to supply more as directed.
Thank you