-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (40 loc) · 1.08 KB
/
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
48
49
50
51
52
53
54
55
# Makefile for Docker Compose project
# Variables
DOCKER_COMPOSE = docker-compose
APP_SERVICE = api
DB_SERVICE = db
# Targets
install:
@echo "Installing Docker Compose project dependencies..."
build:
@echo "Building Docker Compose project..."
$(DOCKER_COMPOSE) build
up:
@echo "Starting Docker Compose services..."
$(DOCKER_COMPOSE) up -d
down:
@echo "Stopping Docker Compose services..."
$(DOCKER_COMPOSE) down
view:
@echo "Viewing Docker Compose services..."
$(DOCKER_COMPOSE) ps
logs:
@echo "Showing Docker Compose logs..."
$(DOCKER_COMPOSE) logs -f
test:
@echo "Running all the tests..."
pyest
restart: down up
shell-app:
@echo "Starting a shell inside the app container..."
$(DOCKER_COMPOSE) exec -it $(APP_SERVICE) /bin/bash
shell-db:
@echo "Starting a shell inside the database container..."
$(DOCKER_COMPOSE) exec -it $(DB_SERVICE) /bin/bash
set-up
@echo "Setting up projetcs..."
python create_tables.py
deploy: install build up view
setup: shell-app set-up
test: shell-app test
.PHONY: install build up down logs restart shell-app shell-db deploy test set-up