generated from codenip-tech/symfony-base-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (30 loc) · 1.29 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
UID = $(shell id -u)
DOCKER_BE = symfony-skeleton-app
help: ## Show this help message
@echo 'usage: make [target]'
@echo
@echo 'targets:'
@egrep '^(.+)\:\ ##\ (.+)' ${MAKEFILE_LIST} | while read -r l; do printf "\033[1;32m$$(echo $$l | cut -f 1 -d':')\033[00m:$$(echo $$l | cut -f 2- -d'#')\n"; done | column -t -c 2 -s ':#'
start: ## Start the containers
cp -n docker-compose.yml.dist docker-compose.yml || true
U_ID=${UID} docker-compose up -d
stop: ## Stop the containers
U_ID=${UID} docker-compose stop
restart: ## Restart the containers
$(MAKE) stop && $(MAKE) start
build: ## Rebuilds all the containers
cp -n docker-compose.yml.dist docker-compose.yml || true
U_ID=${UID} docker-compose build
prepare: ## Runs backend commands
$(MAKE) composer-install
run: ## starts the Symfony development server in detached mode
U_ID=${UID} docker exec -it --user ${UID} ${DOCKER_BE} symfony serve -d
logs: ## Show Symfony logs in real time
U_ID=${UID} docker exec -it --user ${UID} ${DOCKER_BE} symfony server:log
# Backend commands
composer-install: ## Installs composer dependencies
U_ID=${UID} docker exec --user ${UID} ${DOCKER_BE} composer install --no-interaction
# End backend commands
ssh: ## bash into the be container
U_ID=${UID} docker exec -it --user ${UID} ${DOCKER_BE} bash