2023-01-15 15:12:47 +03:00
|
|
|
# Prepare
|
|
|
|
|
|
|
|
Copy all example files and dir
|
|
|
|
|
|
|
|
Cop and set your username:
|
|
|
|
`.env.example`
|
|
|
|
|
|
|
|
Choose php version and redis needed redis containers
|
|
|
|
`docker-compose.yml.example`
|
|
|
|
|
|
|
|
`dockerfiles/workspace/crontab-example`
|
|
|
|
|
|
|
|
`dockerfiles/workspace/aliases.sh.example`
|
|
|
|
|
|
|
|
Set your site(s) root-mappings
|
|
|
|
`config/nginx/conf.d/vhosts.conf.example`
|
|
|
|
|
2021-04-19 14:01:33 +03:00
|
|
|
## First
|
|
|
|
Create alias for `docker-compose` command.
|
2021-04-13 00:01:26 +03:00
|
|
|
|
2021-04-19 14:01:33 +03:00
|
|
|
`echo 'alias dc="docker-compose"' >> ~/.bash_aliases`
|
|
|
|
|
|
|
|
Also, you have might be needed include `~/.bash_aliases` in your `~/.bashrc` file.
|
|
|
|
|
|
|
|
Build all
|
|
|
|
|
|
|
|
`dc build`
|
|
|
|
|
|
|
|
## Second
|
|
|
|
|
|
|
|
Create usefully symlinks
|
|
|
|
|
|
|
|
`./create-symlinks.sh`
|
|
|
|
|
|
|
|
## Get composer auth token
|
|
|
|
|
|
|
|
If you do not have composer github auth.json file in `~/.composer` dir. You will need launch the helper-script:
|
|
|
|
|
|
|
|
`./get-composer-auth.sh`
|
|
|
|
|
|
|
|
## Before use and launch
|
|
|
|
|
|
|
|
You need copy `vhosts.conf.example` and edit this file - remove unused roots (or change to existing dirs).
|
|
|
|
Setup correctly nginx config.
|
|
|
|
|
|
|
|
You ready for up containers.
|
|
|
|
|
|
|
|
`dc up -d`
|
2021-04-13 00:01:26 +03:00
|
|
|
|
|
|
|
## Database dumps
|
|
|
|
|
2021-04-19 14:01:33 +03:00
|
|
|
Database dumps must be placement on `./hostfiles` directory.
|
|
|
|
|
|
|
|
## Bash scripts
|
|
|
|
|
|
|
|
After execute created symlinks, you have some enter-points for vulnerable popular tasks.
|
|
|
|
|
|
|
|
### Xdebug
|
|
|
|
For start debugging in php-fpm, also in workspace
|
|
|
|
|
2023-01-15 15:12:47 +03:00
|
|
|
`./xdebug-start.sh [74|81]` - `74` by default
|
2021-04-19 14:01:33 +03:00
|
|
|
|
|
|
|
For start debugging in php-fpm, also in workspace
|
|
|
|
|
2023-01-15 15:12:47 +03:00
|
|
|
`./xdebug-stop.sh` or `./stop-xdebug.sh 81` if you launch start new php version 81
|
2021-04-19 14:01:33 +03:00
|
|
|
|
2021-08-27 13:36:45 +03:00
|
|
|
#### Xdebug with profiler
|
|
|
|
|
|
|
|
Profiler saved your profiles into `/tmp` directory in own container.
|
|
|
|
|
|
|
|
In docker-compose.base.yml exists volume that represent `/tmp` directory to `./data/profiler`.
|
|
|
|
In this case `./data/profiler` must be have `777` chmod`s.
|
|
|
|
|
|
|
|
For starting xdebug with profiler enable you might:
|
|
|
|
|
2023-01-15 15:12:47 +03:00
|
|
|
`./xdebug-start.sh 74 1`
|
2021-08-27 13:36:45 +03:00
|
|
|
|
|
|
|
Or
|
|
|
|
|
2023-01-15 15:12:47 +03:00
|
|
|
`./xdebug-start.sh 74 profiler` if you like
|
2021-08-27 13:36:45 +03:00
|
|
|
|
|
|
|
Second argument must be have any string
|
|
|
|
|
|
|
|
For disable profiler - just simple launch
|
|
|
|
|
2023-01-15 15:12:47 +03:00
|
|
|
`./xdebug-quit.sh`
|
2021-08-27 13:36:45 +03:00
|
|
|
|
|
|
|
|
2021-04-19 14:01:33 +03:00
|
|
|
### Mysql
|
|
|
|
|
|
|
|
For import dumps from `hostfiles` directory you might be enter to mysql console:
|
|
|
|
|
|
|
|
`./mysql.sh`
|
|
|
|
|
|
|
|
Change you needed database and source to the `*.sql` dump.
|
|
|
|
|
|
|
|
`use mydatabase`
|
|
|
|
|
|
|
|
`source /hostfiles/mydatabase.sql`
|
|
|
|
|
|
|
|
Dump must be extracted before source in mysql-cli
|
|
|
|
|
|
|
|
### Workspace
|
|
|
|
|
|
|
|
For execute composer update|install or nodejs operations, also yarn, npm and all node-builds.
|
|
|
|
You might use `workspace`-container
|
|
|
|
|
|
|
|
For the enter to workspace container with php 7.4 you need launch usefully helper script in your home directory:
|
|
|
|
|
|
|
|
`./enter-to-workspace.sh`
|
|
|
|
|
|
|
|
For enter to `workspace` with php7.3 you need pass `73` container name suffix
|
|
|
|
|
|
|
|
`./enter-to-workspace.sh 73`
|
|
|
|
|
|
|
|
### Nginx
|
|
|
|
|
|
|
|
For restart `nginx` after some changes in nginx configuration, you might:
|
|
|
|
|
|
|
|
`./restart-nginx.sh`
|
|
|
|
|
2023-02-04 17:47:02 +03:00
|
|
|
### Elastic
|
|
|
|
|
|
|
|
Copy example
|
|
|
|
|
|
|
|
Launch:
|
|
|
|
|
|
|
|
`dc -f docker-compose.elastic.yml up -d elastic`
|
|
|
|
|
2021-04-19 14:01:33 +03:00
|
|
|
## Src build need DOCKER_BUILDKIT
|
|
|
|
|
|
|
|
If you want build own workspace image. You need export environment variable
|
|
|
|
|
|
|
|
`export DOCKER_BUILDKIT=1`
|
|
|
|
|
|
|
|
more info https://github.com/edrevo/dockerfile-plus
|