-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (34 loc) · 914 Bytes
/
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
42
43
44
45
.DEFAULT_GOAL := rund
# Load only COMPOSE_ENV from .env
export COMPOSE_ENV := $(shell grep ^COMPOSE_ENV .env | cut -d '=' -f2-)
COMPOSE_ENV ?= dev # Default value if COMPOSE_ENV is not found in .env
COMPOSE_FILE=compose.$(COMPOSE_ENV).yml
.PHONY: gen-env-example
gen-env-example:
sed 's/=.*/=/' .env > .env.example
.PHONY: down
down:
docker compose -f ${COMPOSE_FILE} down
.PHONY: clean
clean:
docker compose -f ${COMPOSE_FILE} down -v --remove-orphans
.PHONY: up
up:
docker compose -f ${COMPOSE_FILE} up
.PHONY: upd
upd:
docker compose -f ${COMPOSE_FILE} up -d
.PHONY: build
build:
docker compose -f ${COMPOSE_FILE} build
.PHONY: run
run:
docker compose -f ${COMPOSE_FILE} up --build
.PHONY: rund
rund:
docker compose -f ${COMPOSE_FILE} up --build -d
.PHONY: pull
pull:
docker compose -f ${COMPOSE_FILE} pull
docker compose -f ${COMPOSE_FILE} up -d --force-recreate
docker image prune -a -f