-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
26 lines (18 loc) · 748 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
# Define the list of environments to deploy
ENVIRONMENTS := dev prod
.PHONY: $(ENVIRONMENTS)
# Pattern rule to deploy environment-specific containers
$(ENVIRONMENTS):
docker compose -f docker-compose.yml -f docker-compose.$@.yml build --no-cache
# Target to start environment-specific images
up:
docker compose -f docker-compose.yml -f docker-compose.$(ENV).yml up -d
down:
docker compose -f docker-compose.yml -f docker-compose.$(ENV).yml down
logs:
docker compose -f docker-compose.yml -f docker-compose.$(ENV).yml logs web -f
# Spins up mongoDB single node replica for local development
mongo:
docker compose -f docker-compose.yml -f docker-compose.dev.yml up mongo -d
# Set default environment to "dev" if not specified
ENV ?= dev