PHP Classes

File: dev/docker/

Recommend this page to a friend!
  Classes of Sergii Pryz   PHP CSV Import to MySQL   dev/docker/   Download  
File: dev/docker/
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP CSV Import to MySQL
Import user data from CSV files into MySQL
Author: By
Last change:
Date: 3 years ago
Size: 2,554 bytes


Class file image Download


Application environment has several containers:

Pre installation

Before start please be sure that was installed:

  1. Docker
  2. Compose


  1. Set environment variable `HOST_IP` with your host machine IP, e.g. `export host_ip=`
  2. Run in application root `sudo docker-compose -f dev/docker/docker-compose.yml up`
  3. Check containers `sudo docker-compose ps`




SSH credentials:

  1. user: `root`
  2. password: `screencast`
  3. ip:
  4. port: 2229

To make connection via console simple run ssh root@ -p 2229.


For configuration MySQL connection inside linked import-web` use:

  • host: import-mysql
  • port: 3306
  • username: 'root'
  • password: 'root'

To get access from hosted machine please use:

  • ip:
  • port: 9306
  • username: 'root'
  • password: 'root'

Usefull commands

  • go to shell inside container `sudo docker-compose -f ./dev/docker/docker-compose.yml exec {{container-name}} bash`
  • build container `sudo docker-compose -f ./dev/docker/docker-compose.yml build {{container-name}}`
  • build container without caching `sudo docker-compose -f ./dev/docker/docker-compose.yml build --no-cache {{container-name}}`

_Note_: please substitute all {{container-name}} by import-web, import-mysql.

For more information please visit Docker Compose Command-line Reference.

Configuration IDE (PhpStorm) ----------------------------

Remote interpreter

  1. Use ssh connection to set php interpreter
  2. Set "Path mappings": `host machine project root->/ImportCsvUser`

More information is here.


  1. Configure UnitTest using remote interpreter.
  2. Choose "Use Composer autoload"
  3. Set "Path to script": `/ImportCsvUser/vendor/autoload.php`
  4. Set "Default configuration file": `/ImportCsvUser/phpunit.xml.dist`

More information is here.