35 lines
983 B
Makefile
35 lines
983 B
Makefile
DIR_SQL=PostgreSQL
|
|
DIR_BACK=back-end
|
|
DOCKER_COMPOSE=docker compose
|
|
|
|
all: build
|
|
|
|
build: dev
|
|
|
|
dev: ${DIR_BACK}/.env
|
|
cd ${DIR_SQL} && make && cd -
|
|
export $(grep -v '^#' back-end/.env.production | xargs)
|
|
(. ${DIR_BACK}/.env && ${DOCKER_COMPOSE} -f docker-compose.dev.yml up) || true
|
|
|
|
prod:
|
|
cd ${DIR_SQL} && make && cd -
|
|
export $(grep -v '^#' back-end/.env.production | xargs)
|
|
(. ${DIR_BACK}/.env.production && ${DOCKER_COMPOSE} -f docker-compose.prod.yml up) || true
|
|
|
|
$(DIR_BACK)/.env: ${DIR_BACK}/.env.example
|
|
cp ${DIR_BACK}/.env.example ${DIR_BACK}/.env
|
|
|
|
clean:
|
|
${RM} ${DIR_BACK}/.env
|
|
# Delete the db volume
|
|
cd ${DIR_SQL} && make clean
|
|
${DOCKER_COMPOSE} -f docker-compose.dev.yml down --rmi local -v --remove-orphans || true
|
|
sudo ${RM} -r dev-db || true
|
|
|
|
clean_prod: clean
|
|
cd ${DIR_SQL} && make clean
|
|
${DOCKER_COMPOSE} -f docker-compose.prod.yml down --rmi local -v --remove-orphans || true
|
|
sudo ${RM} -r database || true
|
|
|
|
.PHONY: clean all prepare_dev build clean_prod
|