mirror of
https://github.com/Luzifer/docker-php5-nginx.git
synced 2024-11-09 14:40:07 +00:00
Added README; Fixed container startup
This commit is contained in:
parent
b9e20ca030
commit
93ffe534e5
4 changed files with 50 additions and 1 deletions
|
@ -19,4 +19,4 @@ RUN \
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
CMD ["nginx"]
|
CMD ["/usr/local/bin/container-run.sh"]
|
||||||
|
|
42
README.md
Normal file
42
README.md
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
# luzifer/php5-nginx Dockerfile
|
||||||
|
|
||||||
|
This repository contains **Dockerfile** of [Nginx](http://nginx.org/) for [Docker](https://www.docker.com/)'s [automated build](https://registry.hub.docker.com/u/luzifer/php5-nginx/) published to the public [Docker Hub Registry](https://registry.hub.docker.com/).
|
||||||
|
|
||||||
|
## Base Docker Image
|
||||||
|
|
||||||
|
- [ubuntu](https://registry.hub.docker.com/_/ubuntu/)
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
1. Install [Docker](https://www.docker.com/).
|
||||||
|
|
||||||
|
2. Download [automated build](https://registry.hub.docker.com/u/luzifer/php5-nginx/) from public [Docker Hub Registry](https://registry.hub.docker.com/): `docker pull luzifer/php5-nginx`
|
||||||
|
|
||||||
|
(alternatively, you can build an image from Dockerfile: `docker build -t="luzifer/php5-nginx" github.com/luzifer/php5-nginx`)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Create a `Dockerfile` similar to the following in your application code folder:
|
||||||
|
|
||||||
|
```
|
||||||
|
FROM luzifer/php5-nginx
|
||||||
|
|
||||||
|
ONBUILD RUN mkdir -p /application
|
||||||
|
ONBUILD ADD . /application
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
CMD ["/usr/local/bin/container-run.sh"]
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, execute the following to build the image:
|
||||||
|
|
||||||
|
docker build -t myuser/myapp .
|
||||||
|
|
||||||
|
This will create an image named `myuser/myapp` with your application ready to go.
|
||||||
|
To launch it, just type:
|
||||||
|
|
||||||
|
docker run -d -p 80 myuser/myapp
|
||||||
|
|
||||||
|
Easy!
|
||||||
|
|
||||||
|
|
4
files/container-run.sh
Normal file
4
files/container-run.sh
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
/etc/init.d/spawn-fcgi start
|
||||||
|
exec nginx
|
|
@ -4,5 +4,8 @@
|
||||||
tasks:
|
tasks:
|
||||||
- include: tasks/nginx.yml
|
- include: tasks/nginx.yml
|
||||||
|
|
||||||
|
- name: Make entrypoint for docker container
|
||||||
|
copy: src=files/container-run.sh dest=/usr/local/bin/container-run.sh mode=0755 owner=root group=root
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- include: handlers/nginx.yml
|
- include: handlers/nginx.yml
|
||||||
|
|
Loading…
Reference in a new issue