-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (41 loc) · 1.47 KB
/
Copy pathMakefile
File metadata and controls
52 lines (41 loc) · 1.47 KB
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
48
49
50
51
52
# Makefile for Docker Compose
# Set the default docker-compose file
DOCKER_COMPOSE_FILE = docker-compose.yml
# Default service (optional)
SERVICE = activerecord-postgis
# Phony targets are those that do not represent actual files
.PHONY: up down start stop restart logs build
# Bring up the Docker services
up:
@docker compose -f $(DOCKER_COMPOSE_FILE) up -d
# Bring down the Docker services
down:
@docker compose -f $(DOCKER_COMPOSE_FILE) down
# Start the Docker services
start:
@docker compose -f $(DOCKER_COMPOSE_FILE) start $(SERVICE)
# Stop the Docker services
stop:
@docker compose -f $(DOCKER_COMPOSE_FILE) stop $(SERVICE)
# Restart the Docker services
restart:
@docker compose -f $(DOCKER_COMPOSE_FILE) restart $(SERVICE)
# Show logs for the Docker services
logs:
@docker compose -f $(DOCKER_COMPOSE_FILE) logs -f $(SERVICE)
# Build or rebuild services
build:
@docker compose -f $(DOCKER_COMPOSE_FILE) build $(SERVICE)
# List out the targets
help:
@echo "Makefile to manage Docker Compose"
@echo ""
@echo "Usage:"
@echo " make up - Bring up the Docker services"
@echo " make down - Bring down the Docker services"
@echo " make start - Start the Docker services"
@echo " make stop - Stop the Docker services"
@echo " make restart - Restart the Docker services"
@echo " make logs - Show logs for the Docker services"
@echo " make build - Build or rebuild services"
@echo " make help - Show this help message"