-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (46 loc) · 3 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
56
57
58
59
60
61
62
63
64
65
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Useful development scripts
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
help:
@echo "================================================================"
@echo "| PIS-project | dev scripts for easy work w/ Docker containers |"
@echo "================================================================"
@echo " make dev \t\tRun (& build) all services (containers)"
@echo " make dev-build \tJust build (or rebuild) all images"
@echo " make dev-restart \tRestart all services (containers)"
@echo " make ps \t\tShow running containers"
@echo " make clean \t\tStop & remove running containers/images"
@echo " ..."
@echo " (for more info, look at the Makefile)"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
dev-build: # Build all services in dev configuration.
docker-compose -f docker-compose.common.yml -f docker-compose.dev.yml build --no-cache
dev-restart: # Restart all services in dev configuration.
docker-compose -f docker-compose.common.yml -f docker-compose.dev.yml restart
dev: # Run all services
docker-compose -f docker-compose.common.yml -f docker-compose.dev.yml up --detach
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
dev-frontend:
docker-compose -f docker-compose.common.yml -f docker-compose.dev.yml up --detach --no-deps --force-recreate frontend
dev-backend:
docker-compose -f docker-compose.common.yml -f docker-compose.dev.yml up --detach --no-deps --force-recreate backend
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
log: # Show logs from all services in a single output stream
docker-compose -f docker-compose.common.yml -f docker-compose.dev.yml logs --follow
log-backend: # Show logs only from 'backend' service container
docker-compose -f docker-compose.common.yml -f docker-compose.dev.yml logs --follow backend
log-frontend: # Show logs only from 'frontend' service container
docker-compose -f docker-compose.common.yml -f docker-compose.dev.yml logs --follow frontend
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
production-build: # Build all services with Production Configuration
docker-compose -f docker-compose.common.yml -f docker-compose.prod.yml build --no-cache
production: # Run all services with Production Configuration
docker-compose -f docker-compose.common.yml -f docker-compose.prod.yml up --detach
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ps: # Show running containers from this Docker Bundle
@echo "DOCKER-COMPOSE IN \033[1mDEV\033[0m CONFIGURATION IS RUNNING THESE CONTAINERS:"
docker-compose -f docker-compose.common.yml -f docker-compose.dev.yml ps
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
clean: # Remove all services with development configuration
docker-compose -f docker-compose.common.yml -f docker-compose.dev.yml down --rmi all
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -