PHPNews

Building an Nginx Image

Written by Servers for Hackers - Published on Servers for Hackers
Aggregated on Saturday August 12, 2017 - Permalink

We cover how I built the Nginx image we used in our Docker setup. Note that the video, as usual, is more comprehensive than these notes! The Dockerfile We use a Dockerfile to define a base image, and the steps to take to use that base image and create our image from it. We can then use that built image and upload it to a container Registry, such as Docker Hub. Or we can use it locally. …

Continue reading »


Building a PHP Image

Written by Servers for Hackers - Published on Servers for Hackers
Aggregated on Saturday August 12, 2017 - Permalink

We cover how I built the PHP image we used in our Docker setup. Note that the video, as usual, is more comprehensive than these notes! The Dockerfile We use a Dockerfile to define a base image, and the steps to take to use that base image and create our image from it. We can then use that built image and upload it to a container Registry, such as Docker Hub. Or we can use it locally. …

Continue reading »


Development Workflow with Docker

Written by Servers for Hackers - Published on Servers for Hackers
Aggregated on Saturday August 12, 2017 - Permalink

We cover how to make running complex Docker commands quickly and easily. We saw how we could use docker-compose to easily get a dev environment up and running. However, we had to run some commands that get pretty long. For example: docker run -it --rm \ -v $(pwd)/application:/opt \ -w /opt \ --network=zondaroad_appnet \ shippingdocker/php \ php artisan make:auth …

Continue reading »


When Localhost isn't the Local Host

Written by Servers for Hackers - Published on Servers for Hackers
Aggregated on Saturday August 12, 2017 - Permalink

We cover a small gotcha that could waste your time. tl;dr If your code (e.g. php/php-fpm) is executed on a separate container as your web server (e.g. nginx), then pinging localhost as an HTTP request wont' work, because there's no web server listening for HTTP requests within your code (php) container! Use the hostname of your Nginx/web server container instead, e.g. http://nginx …

Continue reading »


An Ansible2 Tutorial

Written by Servers for Hackers - Published on Servers for Hackers
Aggregated on Wednesday August 16, 2017 - Permalink

Note : This is an update from the original Ansible article ! This one has been updated for Ansible 2, with some improvements in how I install/run Ansible. Ansible is a configuration management and provisioning tool, similar to Chef, Puppet or Salt. I've found it to be one of the simplest and the easiest to get started with. A lot of this is because it's "just SSH"; It uses SSH to connect …

Continue reading »


Hosting Web Apps

Written by Servers for Hackers - Published on Servers for Hackers
Aggregated on Monday May 8, 2017 - Permalink

We talk about the three main moving parts of hosting a web application: 1. The web server (e.g. Nginx, Apache) 2. The application gateway (e.g. php-fpm, gunicorn) 3. The application (your code) These three pieces are required, but the application gateway isn't often talked about. We'll discuss these parts before moving onto seeing how to install and configure a PHP web application.

Continue reading »