wikiworldorder/docker-survloop

Docker Compose configuration for SurvLoop ^0.1 running PHP 7.3 with Nginx, PHP-FPM, PostgreSQL 11.2 and Composer.

dev-master 2019-04-25 14:28 UTC

This package is auto-updated.

Last update: 2019-12-25 16:22:17 UTC


README

d# docker-survloop Docker Compose configuration for SurvLoop ^0.1 running PHP 7.3 with Nginx, PHP-FPM, PostgreSQL 11.2 and Composer.

Overview

Docker Compose configuration for SurvLoop ^0.1 running PHP 7.3 with Nginx, PHP-FPM, PostgreSQL 11.2 and Composer. It exposes 4 services:

  • web (Nginx)
  • php (PHP 7.3 with PHP-FPM)
  • db (PostgreSQL 11.2)
  • composer
  • survloop

The PHP image comes with the most commonly used extensions and is configured with xdebug. The UUID extension for PostgreSQL has been added. Nginx default configuration is set up for Symfony 4 and serves the working directory. Composer is run at boot time and will automatically install the vendors.

Thank you to https://github.com/ineat/docker-php-nginx-postgres-composer for getting me started in the Docker world.

Install prerequisites

You will need:

How to use it

How To Install SurvLoop with Docker on Digital Ocean

This process runs a variety of Digital Ocean's layered tutorials. I don't understand all of it yet, so will leave the explanations to their superb articles. This variation uses PostgresSQL instead of MYSQL, and it also adds SurvLoop stuff. You should be able to accept the defaults.

After starting up a new Ubuntu 18.04 Droplet, connect it with the root account and your SSH key. The first install script will create a non-root user, e.g. survuser. Be sure to create and save a copy of a strong password, which you'll need handy throughout this install:

$ git clone https://github.com/wikiworldorder/docker-survloop.git /usr/local/lib/docker-survloop
$ chmod +x /usr/local/lib/docker-survloop/bin/*.sh
$ /usr/local/lib/docker-survloop/bin/survloop-install-1.sh survuser

Then exit to logout as root, and log back in as survuser. Your key should work, and you should have sudo power.

$ exit
# ssh survuser@YOUR.SERVER.IP

Now logged in as a non-root user

$ sudo chmod +x /usr/local/lib/docker-survloop/bin/*.sh
$ bash /usr/local/lib/docker-survloop/bin/survloop-install-2.sh
$ cd ~/survloop
$ docker run --rm -v $(pwd):/app composer install
$ docker-compose up -d
$ docker-compose exec app nano .env

Update the .env file for your system with a database password you can create now...

DB_PASSWORD=survlooppass

Add on SurvLoop package...

$ bash /usr/local/lib/docker-survloop/bin/survloop-install-3.sh

Starting Docker Compose

Checkout the repository or download the sources.

Simply run docker-compose up and you are done.

Nginx will be available on localhost:80 and PostgreSQL on localhost:5432.

Change configuration

Configuring PHP

To change PHP's configuration edit .docker/conf/php/php.ini. Same goes for .docker/conf/php/xdebug.ini.

You can add any .ini file in this directory, don't forget to map them by adding a new line in the php's volume section of the docker-compose.yml file.

Configuring PostgreSQL

Any .sh or .sql file you add in ./.docker/conf/postgres will be automatically loaded at boot time.

If you want to change the db name, db user and db password simply edit the .env file at the project's root.

If you connect to PostgreSQL from localhost a password is not required however from another container you will have to supply it.