Skip to content

apache#

description:#

apache is an application for processing requests from browsers and serving web pages for a site.

apache image

source and credits: docker image - httpd:2.4 from Apache Software Foundation

usage#

The program receives HTTP or HTTPS requests from the browser (routed via traefik and returns the response. Local access via http://localhost:8093

The source for the web site is obtained from a shared docker volume where the program mkdocs publishes the site.

dependencies#

preparation: create folders for persistent storage outside of the docker container.

  1. mkdocs
  2. mkdocs/site

installation#

create a stack in portainer with the following code.

 version: '2'

 services:
   apache:
     container_name: apache
     image: httpd:2.4
     restart: unless-stopped
     networks:
       - web
     ports:
       - "8093:80"
     volumes:
       - /var/lib/docker/volumes/myconfigs/_data/mkdocs/docs/site:/usr/local/apache2/htdocs:ro
     labels:
       - traefik.enable=true
       - traefik.http.routers.apache.rule=Host(`www.example.com`) 
       - traefik.http.routers.apache.tls=true
       - traefik.http.routers.apache.tls.certresolver=le
       - traefik.http.middlewares.apache.compress=true
       - traefik.http.routers.apache.entrypoints=websecure

 networks:
     web:
         external:
           name: web