Running Apache server as foreground on Ubuntu with Dockerfile

Running Apache server as foreground on Ubuntu with Dockerfile

Running Apache server as foreground on Ubuntu with Dockerfile. In this example, we are going to install apache web server on Ubuntu machine and access it from the host OS. The point here is that the apache server will always be running as a foreground process.

In this example, we are going to install apache web server on Ubuntu machine and access it from the host OS. The point here is that the apache server will always be running as a foreground process.

Dockerfile

FROM ubuntu:16.04

## Apache ENVs
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_PID_FILE /var/run/apache2/apache2.pid
ENV APACHE_SERVER_NAME localhost

## Install services, packages and do cleanup
RUN apt-get update \
 && apt-get install -y \
    apache2 \
 && rm -rf /var/lib/apt/lists/*

## Copy files
COPY apache-conf /etc/apache2/apache2.conf

## Expose Apache
EXPOSE 80

## Launch Apache
CMD ["/usr/sbin/apache2ctl", "-DFOREGROUND"]

docker apache ubuntu dockerfile

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Docker Explained: Docker Architecture | Docker Registries

Following the second video about Docker basics, in this video, I explain Docker architecture and explain the different building blocks of the docker engine; docker client, API, Docker Daemon. I also explain what a docker registry is and I finish the video with a demo explaining and illustrating how to use Docker hub.

Install Docker | Docker Compose on Ubuntu 20.04

This brief tutorial shows students and new users how to install Docker and Docker Compose on Ubuntu 20.04 | 18.04. Docker software allows visualization at the operating system level..

How to Install and Use Docker on Ubuntu 20.04

This article is a good starting point for beginners to learn how to install and use Docker on a Ubuntu 20.04 Linux system with some basic commands. For this guide, we will install Docker Community Edition (CE).

How to Install Microsoft Teams on Ubuntu 20.04

In this tutorial, we will show you how to install Microsoft Teams on Ubuntu 20.04 machine. we can install teams using Debian installer file or by adding microsoft repository.

How to Monitor Apache Performance Using mod_status in Ubuntu

How to Monitor Apache Performance Using mod_status in Ubuntu. The mod_status module is an Apache module that allows users to access highly detailed information about Apache's performance on a plain HTML page.