fideloper / docker-nginx-php Goto Github PK
View Code? Open in Web Editor NEWAn Ubuntu, Nginx and PHP stack Built in Docker
An Ubuntu, Nginx and PHP stack Built in Docker
How do I run a virtual host like test.dev. I made a test.dev file changing the folder to /var/www/test.dev and added the test.dev in my hosts file and to the dockerfile with ADD. But I cannot run it. How do I do this?
Hi,
I wasted 3 hours on this, so maybe this helps someone:
Nginx was serving stale / old files, only solveable by restarting the boot2docker vm. I blamed nginx, apparently wrongly so.
After a lot of different approaches, I stumbled upon https://jeremyfelt.com/2013/01/08/clear-nginx-cache-in-vagrant/ . I changed the nginx.conf as such:
docker run --rm -t -i fbaaken/nginx-php /sbin/my_init -- bash -l
root@0e96ebfdb15b:/# vi /etc/nginx/nginx.conf
(Edited to sendfile off;)
(Committed container state to new image so to not lose changes)
(Ran from the new image from then on)
Hope this helps someone. I will keep the issue open, maybe there is a way to make this easier to configure when running the container so we can sue the same on in dev / prod environments when it's not running on a Virtualbox image (sendfile should be on in this case).
Best,
Felix
I cant seem to get a php file to run.
I ran the container , with a simple php file that does a die changes the path to my file which was sitting on my host machine. Is there anything else I need to be doing ?
how are you supposed to connect to the db then?
Hey,
Would it be possible for you to publish this repo in Docker Hub as an Automated Build Repository? That way one can do a simple docker pull fideloper/docker-nginx-php
rather than having to clone the repo and build it? Also one can then use the repo as a FROM
in their own Dockerfiles.
You can point the Docker Hub repo at this GitHub repo so you don't need to update it every time you make a commit (similar to what I've done with my docker-couchpotato repository).
Thanks!
Dylan
I got this error when building this on add-apt-repository -y ppa:ondrej/php5
. Here's the error:
gpg: keyring `/tmp/tmp07lyg_wt/secring.gpg' created
gpg: keyring `/tmp/tmp07lyg_wt/pubring.gpg' created
gpg: requesting key E5267A6C from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp07lyg_wt/trustdb.gpg: trustdb created
gpg: key E5267A6C: public key "Launchpad PPA for Ond\xc5\x99ej Sur�" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
self.run()
File "/usr/lib/python3.4/threading.py", line 868, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 687, in addkey_func
func(**kwargs)
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 370, in add_key
return apsk.add_ppa_signing_key()
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 261, in add_ppa_signing_key
tmp_export_keyring, signing_key_fingerprint, tmp_keyring_dir):
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 210, in _verify_fingerprint
got_fingerprints = self._get_fingerprints(keyring, keyring_dir)
File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 202, in _get_fingerprints
output = subprocess.check_output(cmd, universal_newlines=True)
File "/usr/lib/python3.4/subprocess.py", line 605, in check_output
output, unused_err = process.communicate(inputdata, timeout=timeout)
File "/usr/lib/python3.4/subprocess.py", line 936, in communicate
stdout = _eintr_retry_call(self.stdout.read)
File "/usr/lib/python3.4/subprocess.py", line 487, in _eintr_retry_call
return func(*args)
File "/usr/lib/python3.4/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 92: ordinal not in range(128)
Is this issue came from phusion/baseimage?
I edit nginx.conf.
how restart service nginx restart ???
I have followed all the steps mentioned. I ran it and it shows the process has also started. But, when I try to access in browser it shows website not found.
how do I add X-Debug to this docker image?
Currently, It is not working as expected.
Nginx can serve html files but not .php files.
Docker version 1.4.1, build 5bc2ff8
unable to run sqlite applications
Small typo in docker built -t webapp .
- should be docker build -t web app .
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.