#!/usr/bin/make .EXPORT_ALL_VARIABLES: SHELL = /bin/sh export UID=$(shell id -u) export GID=$(shell id -g) # create all the folders needed for the initial install of the applications create-volume-folders: mkdir -p /tmp/mindhug-backend/docker_data/mariadb mkdir -p /tmp/mindhug-backend/docker_data/redis mkdir -p /tmp/mindhug-backend/docker_data/s3 get-users: export UID=$(id -u) && export GID=$(id -g) build-base: docker build --no-cache \ --compress \ -t php-base:latest \ -f ./docker/php-base/Dockerfile . build-cli: docker-compose build --no-cache cli # make fresh installation with all the needed initial dependencies fresh-install: create-volume-folders build-base rebuild-php-cli docker-rebuild docker-up composer-install # the command used to install all the needed in the container vendors install: composer-install # update all the installed vendors in the image/container used composer update: composer-update # clean all the docker resources in the host docker-clean: docker system prune --all # the main command that runs all the services needed to run the app for development purpose docker-up: docker-compose up -d --force-recreate # get down all the services in terms of the project build with docker-compose docker-down: docker-compose down # rebuild and recreate all the existing services docker-rebuild: docker-compose build --no-cache rebuild-web: docker-compose build --no-cache web docker-compose up -d --force-recreate web rebuild-php-cli: docker-compose build php-cli docker-compose up -d --force-recreate php-cli # install all the composer dependencies for the project composer-install: docker-compose run php-cli composer install composer-update: docker-compose run php-cli composer update # used once on initial create of the skeleton of the project new-laravel: docker-compose run php-cli composer create-project --prefer-dist laravel/laravel . # get SSH access to the bash of the CLI container used for artisan commands ssh: docker-compose run php-cli bash ssh-root: docker-compose run --user root php-cli bash # general wrapper of a docker command which lists all the run containers in terms of this prject ls: docker-compose ps docker-login: doctl auth init doctl registry login build: docker build --compress --no-cache -t registry.digitalocean.com/mindhug-registry/mindhug-backend:latest -f ./docker/build/Dockerfile . push: docker push registry.digitalocean.com/mindhug-registry/mindhug-backend:latest deploy: build push run-build-cli: docker run -it --publish 8080:8080 registry.digitalocean.com/mindhug-registry/mindhug-backend:latest /bin/bash run-build: docker run -it --detach --publish 8080:8000 registry.digitalocean.com/mindhug-registry/mindhug-backend:latest