Docker Container for Yii 2.0
:bangbang: We've released
docker-yii2-app an updated version of a minimalistic Yii 2.0 application template.
Basic App Template
Note! This docker container was created as a very basic Yii2 example.
If you would like to use a Yii 2.0 Framework application with a Docker-optimized setup based on environment variables, you
should have a look at Phundament 4.
Get it from Docker Hub!
docker pull schmunk42/yii2-app-basic
Run the container
docker run -p 8888:80 schmunk42/yii2-app-basic
Ctrl+c to stop the process, you can also start the docker process in the background, by adding the
Copy the applictaion template from the image to your host, the following command will create a
myapp app folder in your working directory.
docker run \ -v `pwd`/myapp:/app-install \ schmunk42/yii2-app-basic \ cp -a /app/. /app-install
Now as you have the source-code on your host system, mount the application as volume an re-run the container
cd myapp docker run -d -p 8888:80 \ -v `pwd`:/app \ --name myapp \ schmunk42/yii2-app-basic
Access the application under the URLs mentioned above, you can directly edit the files of your application or run commands like
docker exec myapp ./yii
directly off the running container.