Start DLEMP server with prebuilt docker images. This is much faster than building images from dockerfiles.
We support PHP 5.6 and 7.0
docker-machine ssh default
(Only if you are not on Linux machine)
cd <project-dir>
docker run --rm -it --user=$(id -u):$(id -g) -v $(pwd):/usr/share/nginx/WEBAPP rasodu/cmdlaravel:7.0.1 /bin/bash
laravel new [new-project-dir]
or composer create-project laravel/laravel=5.1.<*|33> <.|new-project-dir>
Add DLEMPFast to your project
docker run --rm -it --user=$(id -u):$(id -g) -v $(pwd):/usr/share/nginx/WEBAPP rasodu/cmdlaravel:7.0.1 /bin/bash
composer require rasodu/services:dev-master
mkdir public
If it doesn't existmkdir -p services/docker-config
.dockerignore
file form rasodu/DLEMP
to your project's root folder
COMPOSE_PROJECT_NAME=<your_project_name>
DLEMPFAST_CONTEXT=../../../../../
DLEMPFAST_BASE_DIR=vendor/rasodu/services/
DLEMPFAST_CONFIG_DIR=vendor/rasodu/services/
DLEMPFAST_PROJECT_DIR=
DLEMPFAST_RASODU_MYSQL_VERSION=5.6.28
DLEMPFAST_RASODU_PHPFPMLARAVEL_VERSION=7.0 DLEMPFAST_RASODU_PHPFPMLARAVEL_CONFIG_DIR=vendor/rasodu/services/ DLEMPFAST_RASODU_PHPFPMLARAVEL_DOCKERFILE_DIR=vendor/rasodu/services/
COMPOSE_FILE=vendor/rasodu/services/services/composefile/phpfpmlaravel/c.yml;vendor/rasodu/services/services/composefile/phpfpmlaravel/c.override.yml;vendor/rasodu/services/services/composefile/httpbackendlaravelnginx/c.yml;vendor/rasodu/services/services/composefile/httpbackendlaravelnginx/c.override.yml;vendor/rasodu/services/services/composefile/loadbalancernginx/c.yml
- ```chmod 777 -R bootstrap/cache/ && chmod 777 -R storage/```
- Try to start server with ```docker-compose up -d``` command
- Once server starts successfully, commit changed files to your project.
Optional installation steps
Add /public/phpunit-coverage
and /public/app-documentation
to your project's '.gitignore' : If you will be generating phpunit code coverage.
If you want to use browser sync, then add following code to 'gulpfile.js'.
mix.browserSync({
proxy: 'https://https',
port: 3002,
ui: {
port: 3001
}
});
cp "vendor/rasodu/services/com/rasodu/zz-other-references/makefiles/Makefile-Laravel" Makefile
and configure Makefile settings for your project : If you want Makefile for your project.mkdir -p com/rasodu/phpfpmlaravel/customization && cp -a vendor/rasodu/services/com/rasodu/phpfpmlaravel/customization/. com/rasodu/phpfpmlaravel/customization/
: If you want to set custom config.docker-compose up -d
: start development serverdocker-compose stop
: stop development serverdocker-compose down --rmi local -v
: remove containers, networks, local images and volumesdocker exec -it --user=$(id -u):$(id -g) <your_project_name>_cmd_1 /bin/bash
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
: to start services on production serverdocker-compose -f docker-compose.yml -f docker-compose.prod.yml build [service-name]
: to build all services or to rebuild single servicedocker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d --no-deps <service-name>
: to start single servicecomposer install --no-dev
composer dump-autoload --optimize
in .env file 'APP_ENV=production' and 'APP_DEBUG=false'
php artisan optimize --force
php artisan route:cache
php artisan config:cache
docker-machine ssh <production-machine-name>
docker run --rm -it -v <project-name>_etc-letsencrypt:/etc/letsencrypt -v <project-name>_acme-challenge:/DLEMP/letsencrypt/public/.well-known/acme-challenge <project-name>_letsencrypt /bin/bash
/DLEMP/letsencrypt/bin/letsencrypt-auto --version
/DLEMP/letsencrypt/bin/letsencrypt-auto certonly --agree-tos
ln -sf /etc/letsencrypt/live/<domain>/privkey.pem /etc/letsencrypt/privkey.pem
ln -sf /etc/letsencrypt/live/<domain>/fullchain.pem /etc/letsencrypt/fullchain.pem
exit
exit
docker-compose -f docker-compose.yml -f docker-compose.prod.yml restart nginxhttps
docker-compose config > compose-combined.yml
$(aws ecr get-login)
docker-compose build
docker push <tag>:<version>
//Push all custom images for the project: docker images | grep -i AmazonEC2ContainerServiceforEC2Role
in aws-elasticbeanstalk-ec2-role
role //this will allow EC2 instances to access EC2 Container RegistryDockerrun.aws.json
Dockerrun.aws.json
in your Elastic Beanstalk Environmenteval $(minikube docker-env)
and docker-compose build
kompose -f compose-combined.yml up
kubectl get deployments,rs,pods,services
kubectl expose deployment <deployment-name> --type=LoadBalancer --port=<port-number> [--target-port=<>]
kubectl edit svc/docker-registry
curl http://$(minikube ip):32599/