forked from LondheShubham153/two-tier-flask-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (41 loc) · 880 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
46
47
# Determine the operating system
OS := $(shell uname)
# Define Docker compose command
DOCKER_COMPOSE := docker-compose
# Define Docker compose service name
SERVICE_NAME := web
# Build target
build:
ifeq ($(OS),Linux)
@echo "Building for Linux"
$(DOCKER_COMPOSE) build
endif
ifeq ($(OS),Darwin)
@echo "Building for macOS"
$(DOCKER_COMPOSE) build
endif
ifeq ($(OS),Windows_NT)
@echo "Building for Windows"
# Add Windows-specific build commands if you wish :P
endif
# Run target
run:
ifeq ($(OS),Linux)
@echo "Running for Linux"
$(DOCKER_COMPOSE) up -d
endif
ifeq ($(OS),Darwin)
@echo "Running for macOS"
$(DOCKER_COMPOSE) up -d
endif
ifeq ($(OS),Windows_NT)
@echo "Running for Windows"
# Add Windows-specific run commands if you wish :P
endif
# Stop target
stop:
$(DOCKER_COMPOSE) down
# Clean target
clean: stop
$(DOCKER_COMPOSE) rm -f
docker system prune -f