I think kke_lab_devops-docker-app failed incorrectly

Hi,

kke_lab_devops-docker-app says it failed with “Seems like host volume ‘/var/www/html’ is not mapped correctly with ‘php_web’ container volume on Applicaton Server 1”

But in my docker-compose.yml file I had

 volumes:
    - /var/www/html:/var/www/html

The same syntax worked for the database volume. Also, when testing the application with

curl stapp01:3003

I was successfully able to read

/var/www/html/index.php

from the host within the container, which makes me think it was working. Is my understanding wrong or is there an issue with this task?

Bump, really don’t think I did anything wrong here.

What is the actual task?

Nautilus Application development team has finished development of one of the app recently which they want to deploy on a containerized platform. Nautilus Application development and DevOps team had a meeting to discuss some of the basic pre-requisites and requirements to complete the deployment. Team want to test the deployment on one of the app server before going live and they want to setup complete containerized stack using a docker compose fie. Please find below mentioned details about the task:

On app server 1 in Stratos Datacenter create a docker compose file /opt/finance/docker-compose.yml (should be named exactly).

The compose should deploy two services web and DB and each service should deploy a container as per details mentioned below:

For web service:

a. Container name must be php_web.

b. Use image php with any apache tag. Check here for more details https://hub.docker.com/_/php?tab=tags.

c. Map php_web container’s port 80 with host port 3003

d. Map php_web container’s /var/www/html volume with host volume /var/www/html.

For DB service:

a. Container name must be mysql_web.

b. Use image mariadb with any tag (preferably latest). Check here for more details https://hub.docker.com/_/mariadb?tab=tags.

c. Map mysql_web container’s port 3306 with host port 3306

d. Map mysql_web container’s /var/lib/mysql volume with host volume /var/lib/mysql.

e. Set MYSQL_DATABASE=database_web and use user root with some complex password for DB connections.

After running docker-compose up finally you can access the app with curl command curl :3003/
For more details check here: https://hub.docker.com/_/mariadb?tab=description

Note: Once you click on FINISH button all currently running/stopped containers will be destroyed and stack will be deployed again using your compose file.

# My yaml file had, which worked fine when I tested it.
....
php_web:
    ports:
      - "3003:80"
    volumes:
      - /var/www/html:/var/www/html # host:container
    image: php:apache
....

The host /var/www/html had a file called index.php which I successfully could access through the container, making me believe that the mapping was working.

How to get someone to look at this? I still think this was incorrectly failed.

@mmumshad can you please get someone to look at this, I think this has failed incorrectly.