Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xethron/docker-php56
Cal Evans made me do it
https://github.com/xethron/docker-php56
Last synced: about 1 month ago
JSON representation
Cal Evans made me do it
- Host: GitHub
- URL: https://github.com/xethron/docker-php56
- Owner: Xethron
- Created: 2016-10-27T22:04:58.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-27T22:10:37.000Z (about 8 years ago)
- Last Synced: 2024-10-15T03:42:44.024Z (3 months ago)
- Language: PHP
- Size: 13.8 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# (DEV ONLY) PHP docker image
This is a little docker image I use for development. It has a few features to make your life easier. Not sure about security, but wouldn't trust it in Production.
## Building the image
`docker build -ti xethron/php56 .` (note the period at the end)## Running the image
```bash
#!/bin/bash
docker run --name phpdev --rm \
-v /home/xethron/projects:/var/www \
-v /home/xethron/php56/data:/data/ \
-v /home/xethron/php56/config:/config/ \
-p 80:80 \
-p 242:22 \
-i -t xethron/php56
```
Personally, my life is a mess, so I link in every project individually:
```
-v /some/path/to/project:/var/www/project1 \
-v /another/path/whoo:/var/www/better_project \
-v /some/structured/path/my-first-project:/var/www/my_project \
```## Setting up hosts files
I search for any *.site file in /var/www/*/*.site, so simply add a .site file in the root of every project, and it will automatically be enabled. It will also add all the domain names specified to the dockers /etc/hosts file incase one application calls another, or perhaps even itself... Every project's .site file name must be unique!Here is one I created for my Symposiumapp dev called symposium.site
```apacheDocumentRoot /var/www/symposium/public
ServerName symposiumapp.local
ServerAlias www.symposiumapp.localTransferLog /var/log/apache2/symposium_access.log
ErrorLog /var/log/apache2/symposium_error.log
RewriteEngine On# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
```
You'll have to point symposiumapp.local to localhost in the host machine's /etc/hosts file, but inside the docker, it is already done...