Create a Docker image for Php
Using Codefresh pipelines
Codefresh can work with Php projects using any of the popular frameworks (Laravel, Symphony, CakePHp etc.)
The example php project
You can see the example project at https://github.com/codefresh-contrib/php-composer-sample-app. The repository contains a simple Php project that uses composer as a package manager.
The dockerfile uses multi-stage builds to minimize the size of the docker image.
Create a Docker image for Php project
Once you run this pipeline Codefresh will create a Docker image for the Php application:
Notice that all dependencies are downloaded when the dockerfile is created.
Launch Docker images
Codefresh can also launch Docker images (using Docker swarm behind the scenes). With each Codefresh account you get access to a limited number of Docker environments that can host any Docker image or Docker compose file.
First find your images in the internal Codefresh registry.
Click on the launch button and a new pipeline will run for deployment:
Notice that the pipeline logs show the dynamic URL of the application. Simply visit it with your browser and you will see the result.
Notice that these environments are only for testing and previewing your application as it is developed. They are NOT for production purposes.