Create Phpnuget server in docker
328
Host your own nuget feed with this docker image running phpnuget from kendar.org.
git clone https://github.com/MarkProminic/Docker-phpnuget.git
cd Docker-phpnuget
docker build -t myorganziation/phpnugetv4.1 .
docker run -d -p 80:80 -p 443:443 -e DOMAINS="chocolatey.my.domain.net" -e VHOST1="chocolatey.my.domain.net" -e WEBMASTER_MAIL="[email protected]" -e STAGING="false" -v /choco/:/app/phpnuget/data/ --dns 1.1.1.1 --name MyPHPNuGETV2 myorganziation/phpnugetv4.1
If you want to use your own SSL cert and key, then you need to place them inside the path that you have mounted as the data store. in the Above example it would be /choco/ssl
Naming your files privkey.pem and fullchain.pem will allow you to run the container without specifying the environmental variables. If you need to specify the names, use the Environmental variabels as decribed below.
docker run -d -p 80:80 -p 443:443 -e DOMAINS="chocolatey.my.domain.net" -e VHOST1="chocolatey.my.domain.net" -e WEBMASTER_MAIL="[email protected]" -e STAGING="false" -v /choco/:/app/phpnuget/data/ -e SSLCRT=fullchain.pem -e SSLCRT=privkey.pem --dns 1.1.1.1 --name MyPHPNuGETV2 myorganziation/phpnugetv4.1
During the first few minutes the site will load a temporary SSL while Let's Encrypt Fetches a live certifcate. Simply refresh the page after a few minutes to see an updated cert.
If you need to store large static files you can mount a host path as follows:
docker run -d -p 80:80 -p 443:443-e DOMAINS="chocolatey.my.domain.net" -e VHOST1="chocolatey.my.domain.net" -e WEBMASTER_MAIL="[email protected]" -e STAGING="false" -v /choco/:/app/phpnuget/ -v /data/:/app/phpnuget/data/ -v /static/:/app/static/ -e STAGING="true" --dns 1.1.1.1 --name MyPHPNuGETV2 myorganziation/phpnugetv4.1
Where /static is a path on the host and /app is symlinked to /var/www/html in the container.
Environmental Variables:
| Varible | Value |
|---|---|
| VHOST1 | This is to specify which virutalhost the SSL should be applied to. |
| DOMAINS | This is to specify all the domains that should be issued. |
| STAGING | Supposed to only pull staging certifcates. |
| WEBMASTER_MAIL | Is a required field for Let's Encrypt. |
| SSLCRT | file name of a PEM formatted SSL CERT to use in lieu of Let's Encrypt, if using the /choco directory above, then place it inside of that folder ssl/ |
| SSLKEY | file name of a PEM formatted SSL KEY to use in lieu of Let's Encrypt, if using the /choco directory above, then place it inside of that folder plus ssl/ |
Point your web browser to http://<yourhost>/setup.php
Change settings and hit "Install".
| Notes | |
|---|---|
| Nb! Leave "Application Path:" | as is (phpnuget) |
| Field "php-cgi.exe (for IIS):" | could be emptied. |
Happy nugetting!
Credit where due:
Base Dockerfile Idea: https://github.com/tunisiano187/Docker-phpnuget
Let'sEncrypt on Apache inside of Docker: https://github.com/BirgerK/docker-apache-letsencrypt
Content type
Image
Digest
Size
169.3 MB
Last updated
over 5 years ago
docker pull tunisiano187/phpnuget