alpine-apache

What is Apache?

The Apache HTTP server is a software (or program) that runs in the background under an appropriate operating system, which supports multi-tasking, and provides services to other applications that connect to it, such as client web browsers. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards.

http://httpd.apache.org/

Why use this image?

To get this image

The recommended way to get this Alpine Apache Docker Image is to pull the prebuilt image from the Docker Hub Registry.

$ docker pull docker.io/sanjaysrikakulam/alpine-apache:latest

Once you pulled the image, you can use docker-compose to create/start the container

Docker Compose

$ docker-compose up -d

Hosting a website

$ setup_docker_container.sh -p </docker/docker-containers/> -d <alpine-apache> -c <alpine-apache>

Accessing your server from the host

To access your web server from your host machine you can manually specify the ports you want to be forwarded from your host to the container by editing this section of the docker-compose.yml file

    ports:
      - '8080:80'
      - '443:443'

If you can assign every Docker container a valid public IP address, then configure your container with this compose setup

version: '2'
services:
    apache:
        image: docker.io/sanjaysrikakulam/alpine-apache:latest
        restart: unless-stopped
        container_name: $container_name
        hostname: <Please add the hostname name here>
        ports:
            - "80"
            - "443"
        cap_add:
            - NET_ADMIN
            - NET_RAW
        volumes:
            - ./extra-conf.d:/etc/apache2/extra-conf.d:ro
            - ./htdocs:/var/www/htdocs:Z
            - ./certs:/etc/ssl/apache2:ro
            - ./apache-log:/var/www/logs:Z
        networks:
            outside:
                ipv4_address: <Please add the ip address for this container here>
        environment:
            SERVER_NAME: <Please add the Server name here>
            REDIRECT_HTTP_TO_HTTPS : "true"
            ENABLE_HSTS: "true"
            ENABLE_MOD_PROXY: "true"
	    
networks:
    outside:
        external:
            name: <docker network name>

Configuration

Environment variables

When you start the alpine-pache image, you can adjust the configuration of the instance by enabling or disabling one or more environment variable in the docker-compose file

SSL Certificates

Issues

If you encountered a problem running this container, you can file an issue. For me to provide any form of support, be sure to include the following information in your issue:

License

GNU GENERAL PUBLIC LICENSE v2.0

Possible implementations (environment variable based)