-
install docker
- on Windows turn on your installed WSL distribution in Docker: settings ~> resources
- check that your BIOS settings has a Virtualization option and it's
enabled
-
run command in terminal
cp .env.local .env(in project root folder) -
.env-- replaceAPP_NAME,COMPOSE_PROJECT_NAMEto your app name; replaceDB_HOSTtomysqlAPP_NAME=umi-blueprint DB_HOST=mysql COMPOSE_PROJECT_NAME=umi-blueprint.test
-
IF you need NODE / REDIS services for development, add this to
docker-compose.yml>>servicessectionredis: image: redis container_name: ${COMPOSE_PROJECT_NAME}-redis ports: - 6379 <<: *networks node: build: context: ./docker/node/ dockerfile: ./Dockerfile container_name: ${COMPOSE_PROJECT_NAME}-node volumes: - ./:/var/www/${COMPOSE_PROJECT_NAME} <<: *working_dir
For REDIS your also need to add
nginxdependencynginx: depends_on: ... - redis
IF your containers already running (check statuses with
docker-compose ps) and you are adding new services,
rebuild them withdocker-compose up -d --build
IF you need a certain version of NODE, specify it in the config
/docker/node/Dockerfile>>FROM node:specific_version_number(autocomplete will give you all options)Docker generates dynamic ports every time when you build containers. you can add (in project root folder)
docker-compose.override.ymlto make your project ports static. So after container's rebuild you will always see your project on the certain port:# Example of docker-compose.override.yml services: nginx: ports: - 7000:80 mysql: ports: - 7706:3306 # you may need it for laravel projects in case of user rights error php: user: "1000:1000" # `7000` is a desired port.
-
add
COMPOSE_PROJECT_NAMEvalue from.envto yourhostsfile as127.0.0.1 project_name_you_choose -
change the folder template name of you
PROJECTinside templates folder -
start docker in terminal --
docker-compose up -d(in project root folder) -
type in terminal
docker-compose psand getportfromnginxservice (or usedocker-compose.overridevalues). -
project will be available by the address
http://project_name_you_choose:portin case of 403 error go to nginx cli in docker desktop and type
chmod -R 775 [folder name] -
Import DB (you have 2 options) After installing UMI / pulling core files from digital
containers need to be running. check statuses with
docker-compose ps- place your DB dump (rename it as
backup) into folder/docker/mysql/dump/
Support all default extensions*.sql/*.sql.gz/*.tgz
if you have problems with import archived mysql files then use
gunzipon file to unzip it first- use command terminal with
bash(PowerShell / GitBash on Windows) support and run commands:
> . /docker/mysql/backup.sh (`.` is a command) > restore_database
- wait until progress bar finish at 100%
OR
You can add your database dump manually.
- set database connection via any database gui (Workbench, MyAdmin, Navicat, etc.):
get credentials from.env+docker-compose psand getportfrommysql - import your DB dump to database
- place your DB dump (rename it as
-
install UMI in trial mode,
without template- during the installation fill DB host field as
mysqland set DB credentials from your.envfile
- during the installation fill DB host field as
-
config.iniinsidePROJECTfolder -- replacePROJECTwith the name of you project -
root
config.iniin [connections] section -- change mysql host tocore.host = "mysql" -
templates/PROJECT/classes/sitePhpExtension.php-- replacePROJECTinside with correct settings "container_id" -
add all dependencies to
composer.jsonand rundocker-compose exec php composer install(in project root folder) -
all resources (js/css/fonts/images etc.) are placed in
templates/PROJECT/public/. Run commands to build frontend (if exist).
.gitignore-- replacePROJECTwith the name of you project folder.git-ftp-ignore-- replacePROJECTwith the name of you project folder
frontend can skip this step
>>
- add
DEPLOY_USER/DEPLOY_KEY(private) andSLACK_BOT_TOKENto secrets section .github/workflows/deploy-pipelines.yml-- replacePROJECTwith the name of you project folder / domain name of you dev env- fill all necessary variables in
envsection
- add
DEPLOY_USER/STAGING_PRIVATE_KEYto CI/CD variables section .gitlab-ci.yml-- replacePROJECTwith the name of you project folder / domain name of you dev env- fill all necessary variables in
variablessection
<<frontend can skip this step
- create 2 separate projects for
frontendandbackendteams with thePROJECT-frontend/backendnames - add
VERSION_POSTFIXenvironment variable inside VCS system which will represent yourPROJECTname
- In case of
403 error(UMI ISinstalled) go to nginx cli in DockerDesktop OR in linux / WSL terminal and typechmod -R 775 [folder name] - In case of
504 errorduring UMI installation go to docker/nginx/templates folder and add new linefastcgi_read_timeout 240insidelocation ~ \.php$ { ... }section of template file.
- In case of MySQL errors when building containers (using
docker compose up -dcommand),
try to changeimagein /docker/mysql/Dockerfile toFROM mariadb:10.8also check that COMPOSE_PROJECT_NAME don't contain“.”else replace it with“-”
