The Nautilus application development team shared static website content that needs to be hosted on the httpd web server using a containerised platform. The team has shared details with the DevOps team, and we need to set up an environment according to those guidelines. Below are the details:
On App Server 3 in Stratos DC create a container named httpd using a docker compose file /opt/docker/docker-compose.yml (please use the exact name for file).
Use httpd (preferably latest tag) image for container and make sure container is named as httpd; you can use any name for service.
Map 80 number port of container with port 3003 of docker host.
Map container’s /usr/local/apache2/htdocs volume with /opt/itadmin volume of docker host which is already there. (please do not modify any data within these locations).
Make sure docker is running and accessible, you can check simply runing:
docker ps
Let’s create the /opt/docker/docker-compose.yml file:
sudo touch /opt/docker/docker-compose.yml
Let’s run the compose file
docker compose -f /opt/docker/docker-compose.yml up -d
Let’s verify if it’s running or not
docker ps
It should display the output like this:
banner@stapp03 ~]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
31c6d90cafa8 httpd:latest "httpd-foreground" 37 seconds ago Up 35 seconds 0.0.0.0:3003->80/tcp httpd
docker-compose up -d (start services)docker-compose down (stop and remove)docker-compose logs (view service logs)docker-compose up --scale service=3