https://github.com/shipping-docker/php-for-zeit
A test repo to run Nginx/PHP on zeit.co
https://github.com/shipping-docker/php-for-zeit
Last synced: over 1 year ago
JSON representation
A test repo to run Nginx/PHP on zeit.co
- Host: GitHub
- URL: https://github.com/shipping-docker/php-for-zeit
- Owner: shipping-docker
- Created: 2017-03-02T22:03:44.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-02T22:04:06.000Z (over 9 years ago)
- Last Synced: 2025-04-03T04:12:14.271Z (over 1 year ago)
- Language: Shell
- Size: 2.93 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Dockerized PHP/Nginx for Zeit
A test repo to run Nginx/PHP on zeit.co.
## Build It:
```bash
docker build zeit:latest .
```
## Run it:
We can run it and see it in our browser at `localhost`.
> You'll get an error if you have something listening on port 80 already. Use an alternative port in that case - `-p 8888:80`
```bash
mkdir public
echo " public/index.php
# Note we expect directory "public"
# to be in our current working directory
docker run -dit --rm \
--name=myphp
-v $(pwd):/var/www/html -p 80:80 zeit
```
We can also run one-off commands
```bash
# Make a new container and creat a one-off command
# In which case, we set the current working directory
docker run -dit --rm \
-v $(pwd):/var/www/html
-w /var/www/html \
zeit composer update
```
Or run a command from within an already-running container
```bash
# Assume container is named "myphp"
docker exec -it myphp sh -c "cd /var/www/html && composer update"
```