Docker: PHP deployment in apache, couldn't acces container URL in local browser; shows blank page I'm trying to deploy PHP files in Apache container using Dockerfile, Dockerfile on console shows successfully built and tagged but after running the container, i couldn't access the container IP or Container URL in local browser

Dockerfile

FROM ubuntu:bionic
RUN apt-get update
RUN apt-get install -y software-properties-common &amp;&amp; \add-apt-repository ppa:ondrej/php &amp;&amp; apt-get update
RUN apt-get -y upgrade &amp;&amp; DEBIAN_FRONTEND=noninteractive apt-get -y install \
apache2 php7.0 php7.0-mysql libapache2-mod-php7.0
RUN sed -i "s/short_open_tag = Off/short_open_tag = On/" /etc/php/7.0/apache2/php.ini
RUN sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/7.0/apache2/php.ini

ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid

EXPOSE 80
ADD www /var/www/site
ADD apache-config.conf /etc/apache2/sites-enabled/000-default.conf
ADD hosts /etc/hosts
CMD /usr/sbin/apache2ctl -D FOREGROUND ```
You need to expose the container ports locally using either:


docker run --rm -it -p 8080:80 myapp
or a docker-compose.yml file:


services:
  myapp:
    image: myapp:tag
    ports:
    - 8080:80


Then, you'll be able to curl localhost:8080.