You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

136 lines
2.9 KiB

  1. # Prepare
  2. Copy all example files and dir
  3. Cop and set your username:
  4. `.env.example`
  5. Choose php version and redis needed redis containers
  6. `docker-compose.yml.example`
  7. `dockerfiles/workspace/crontab-example`
  8. `dockerfiles/workspace/aliases.sh.example`
  9. Set your site(s) root-mappings
  10. `config/nginx/conf.d/vhosts.conf.example`
  11. ## First
  12. Create alias for `docker-compose` command.
  13. `echo 'alias dc="docker-compose"' >> ~/.bash_aliases`
  14. Also, you have might be needed include `~/.bash_aliases` in your `~/.bashrc` file.
  15. Build all
  16. `dc build`
  17. ## Second
  18. Create usefully symlinks
  19. `./create-symlinks.sh`
  20. ## Get composer auth token
  21. If you do not have composer github auth.json file in `~/.composer` dir. You will need launch the helper-script:
  22. `./get-composer-auth.sh`
  23. ## Before use and launch
  24. You need copy `vhosts.conf.example` and edit this file - remove unused roots (or change to existing dirs).
  25. Setup correctly nginx config.
  26. You ready for up containers.
  27. `dc up -d`
  28. ## Database dumps
  29. Database dumps must be placement on `./hostfiles` directory.
  30. ## Bash scripts
  31. After execute created symlinks, you have some enter-points for vulnerable popular tasks.
  32. ### Xdebug
  33. For start debugging in php-fpm, also in workspace
  34. `./xdebug-start.sh [74|81]` - `74` by default
  35. For start debugging in php-fpm, also in workspace
  36. `./xdebug-stop.sh` or `./stop-xdebug.sh 81` if you launch start new php version 81
  37. #### Xdebug with profiler
  38. Profiler saved your profiles into `/tmp` directory in own container.
  39. In docker-compose.base.yml exists volume that represent `/tmp` directory to `./data/profiler`.
  40. In this case `./data/profiler` must be have `777` chmod`s.
  41. For starting xdebug with profiler enable you might:
  42. `./xdebug-start.sh 74 1`
  43. Or
  44. `./xdebug-start.sh 74 profiler` if you like
  45. Second argument must be have any string
  46. For disable profiler - just simple launch
  47. `./xdebug-quit.sh`
  48. ### Mysql
  49. For import dumps from `hostfiles` directory you might be enter to mysql console:
  50. `./mysql.sh`
  51. Change you needed database and source to the `*.sql` dump.
  52. `use mydatabase`
  53. `source /hostfiles/mydatabase.sql`
  54. Dump must be extracted before source in mysql-cli
  55. ### Workspace
  56. For execute composer update|install or nodejs operations, also yarn, npm and all node-builds.
  57. You might use `workspace`-container
  58. For the enter to workspace container with php 7.4 you need launch usefully helper script in your home directory:
  59. `./enter-to-workspace.sh`
  60. For enter to `workspace` with php7.3 you need pass `73` container name suffix
  61. `./enter-to-workspace.sh 73`
  62. ### Nginx
  63. For restart `nginx` after some changes in nginx configuration, you might:
  64. `./restart-nginx.sh`
  65. ### Elastic
  66. Copy example
  67. Launch:
  68. `dc -f docker-compose.elastic.yml up -d elastic`
  69. ## Src build need DOCKER_BUILDKIT
  70. If you want build own workspace image. You need export environment variable
  71. `export DOCKER_BUILDKIT=1`
  72. more info https://github.com/edrevo/dockerfile-plus