Dockerfile for PHP service

I need to create a Dockerfile for my php service. I just tried many options found in web, and none work correctly. I have simple PHP project in /home/karol/docker-file/service/start.php. Really important for me. Thanks in advance.

Currently looking like this:

  • How to create and download image from Docker container running in Docker Swarm
  • docker blockio can not monitor when using dd to test
  • How can I make a HTTP request from one docker container to another linked container?
  • Where are docker images gcloud should build from
  • Datadog-agent spun up within docker container outputs JMX RMI connection error
  • docker to connect with mysql database of host system and dump the sql file into host system and then host a web application
  • FROM php:5.6-apache
    COPY  ./ /var/www/html/
    WORKDIR /usr/src/service
    CMD [ "php", "./requestdispatcher.php" ]
    

  • export and import docker data containers
  • Creating a container with a variable port
  • copy file from container to the host before the container dies
  • Node Cluster and/or Docker Cluster?
  • FeignClient call with consul service throws connection refused in docker container
  • How to get a container's info when using rhuss/docker-maven-plugin?
  • One Solution collect form web for “Dockerfile for PHP service”

    Reference: https://hub.docker.com/_/php/

    DockerFile
    
    FROM php:5.6-cli
    COPY  /home/karol/docker-file/service /usr/src/service
    WORKDIR /usr/src/service
    CMD [ "php", "./start.php" ]
    

    Build docker image

    docker build -t imagename .

    Run container

    docker run -it –rm –name conatainername imagename

    When running as a service

    FROM php:5.6-apache
    COPY  /home/karol/docker-file/service /var/www/html/
    

    Build Image

    docker build -t imagename .

    Run Container

    docker run -d -p 8080:80 –name conatainername imagename

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.