HTML docker hello world
366
This project demonstrates a simple "Hello World" HTML page served via Apache inside a Docker container.
The Dockerfile uses the official Apache image (httpd:2.4), copies the index.html file to the Apache server's document root, and exposes port 80.
# Use the official Apache image from Docker Hub
FROM httpd:2.4
# Copy your HTML file to the container
COPY ./index.html /usr/local/apache2/htdocs/
# Expose port 80 for HTTP access
EXPOSE 80
version: '3.8'
services:
myapp:
build: .
ports:
- '80:80'
volumes:
- .:/usr/local/apache2/htdocs/
<!DOCTYPE html>
<html>
<body>
<h2>HELLO WORLD Success</h2>
</body>
</html>
Build the Docker image
docker-compose build
Run the Docker container
docker-compose up
Access the Application
Open your browser and go to http://localhost. You should see the message HELLO WORLD Success displayed.
Content type
Image
Digest
sha256:39f9d8ec8…
Size
56.6 MB
Last updated
almost 2 years ago
docker pull cabohorquez/holamundohtml-myapp