Skip to content

Docker installation

Papoteur edited this page Mar 4, 2023 · 2 revisions

⚠ This is experimental. Feedback is welcome

Installation using docker

Docker allow to run the services in a virtual environment and as such, allow to run a specific version of apache-php and of mysql. This allows, we hope, an easier way for the installation. The image is based on Debian.

Instructions for the installation

Install docker for your platform.

Install git if you don't have it yet.

In console, create a directory of your choice, and move inside it.

Clone the repository containing the docker instructions:

git clone https://github.com/papoteur-mga/phpip-docker.git
cd phpip-docker

Launch the build of the image:

docker-compose build

If all went OK, launch the machine:

docker-compose up

Launch the script to get phpip code through a git clone, composer installation, database initialization and to do various settings:

docker-compose exec php-apache bash install-phpip-docker.sh

With default configuration, you will get the application at this link

Settings

Database

For accessing the database:

docker-compose exec mysql  mysql -u root -p

The first mysql is the name of the docker machine. The second is the command to execute in the machine.

Application settings

phpip clone is stored in app directory. app contains a .env.docker file with settings for the application, which is then copied as .env in the application folder.

Restore a backup

Place the backup file in script directory, for example backup.sql. This directory as been declared accessible from mysql docker machine.

Launch a access to mysql as shown above.

Then in mysql, delete the database, create it again and import your backup file :

drop database phpip;
CREATE DATABASE IF NOT EXISTS phpip DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
source script/backup.sql;

Update the application

You can access the apache machine with a bash console, and then apply standard instructions:

docker-compose exec php-apache bash