> For the complete documentation index, see [llms.txt](https://did-web.gitbook.io/notas-docker/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://did-web.gitbook.io/notas-docker/dockerfiles-ejemplos/centos-+-apache2-+-archivos-html.md).

# Centos + apache2 + archivos HTML

Sencillo ejemplo de **Dockerfile** con Centos, Apache2 y archivos HTML.

```
FROM centos

LABEL version="1.0.0"
LABEL description="Esto es mi primera web con Docker"
LABEL vendor="yo"

RUN yum install httpd -y

WORKDIR /var/www/html

COPY mi_web .

RUN echo "$(whoami)" > ./user1.html

RUN useradd eduardo

RUN chown eduardo /var/www/html -R

USER eduardo

ENV contenido prueba2

RUN echo "$contenido creado por <b> $(whoami) </b>" > /tmp/prueba.html 


USER root

RUN cp /tmp/prueba.html ./prueba.html

COPY run.sh /run.sh

CMD sh /run.sh
```

####

#### **Estructura de directorios.**

Dockerfile\
run.sh\
mi\_web\
&#x20;   |\_\_\_\_\_ index.html

**run.sh**

```
#!/bin/bash

echo "Iniciando container..."
apachectl -DFOREGROUND
```

**index.html**

```
<h1>Mi WEB</h1>
<p>
Mi primer Docker con HTML
</p>
```

## **Crear Imagen**

```
docker buil -t <nombre>:<tag> .
```

## Montar Contenedor

```
docker run -d --name <nombre contenedor> -p 8001:80 <nombre imagen>
```
