Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (47 loc) · 2.67 KB
/
Copy pathMakefile
File metadata and controls
64 lines (47 loc) · 2.67 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
53
54
55
56
57
58
59
60
61
62
63
64
DATABASE_COMPOSE_FILE = docker/database/docker-compose.yml
DEVELOPMENT_COMPOSE_FILE = docker/development/docker-compose.yml
STAGING_COMPOSE_FILE = docker/staging/docker-compose.yml
PRODUCTION_COMPOSE_FILE = docker/production/docker-compose.yml
.PHONY: development-build development-up development-build-up development-down development-down-build-up \
staging-build staging-up staging-build-up staging-down staging-down-build-up \
production-build production-up production-build-up production-down production-down-build-up \
cleanup
## Development environment commands
development-build: ## Build the development docker image.
docker compose -f $(DEVELOPMENT_COMPOSE_FILE) build
development-up: ## Start the development docker container.
docker compose -f $(DEVELOPMENT_COMPOSE_FILE) up -d
development-build-up: ## Build and start the development docker container.
docker compose -f $(DEVELOPMENT_COMPOSE_FILE) up --build -d
development-down: ## Stop the development docker container.
docker compose -f $(DEVELOPMENT_COMPOSE_FILE) down
development-down-build-up: ## Stop, build and start the development docker container.
docker compose -f $(DEVELOPMENT_COMPOSE_FILE) down && \
docker compose -f $(DEVELOPMENT_COMPOSE_FILE) up --build -d
## Staging environment commands
staging-build: ## Build the staging docker image.
docker compose -f $(STAGING_COMPOSE_FILE) build
staging-up: ## Start the staging docker container.
docker compose -f $(STAGING_COMPOSE_FILE) up -d
staging-build-up: ## Build and start the staging docker container.
docker compose -f $(STAGING_COMPOSE_FILE) up --build -d
staging-down: ## Stop the staging docker container.
docker compose -f $(STAGING_COMPOSE_FILE) down
staging-down-build-up: ## Stop, build and start the staging docker container.
docker compose -f $(STAGING_COMPOSE_FILE) down && \
docker compose -f $(STAGING_COMPOSE_FILE) up --build -d
## Production environment commands
production-build: ## Build the production docker image.
docker compose -f $(PRODUCTION_COMPOSE_FILE) build
production-up: ## Start the production docker container.
docker compose -f $(PRODUCTION_COMPOSE_FILE) up -d
production-build-up: ## Build and start the production docker container.
docker compose -f $(PRODUCTION_COMPOSE_FILE) up --build -d
production-down: ## Stop the production docker container.
docker compose -f $(PRODUCTION_COMPOSE_FILE) down
production-down-build-up: ## Stop, build and start the production docker container.
docker compose -f $(PRODUCTION_COMPOSE_FILE) down && \
docker compose -f $(PRODUCTION_COMPOSE_FILE) up --build -d
## Cleanup command
cleanup: ## Free up space by removing unused docker images and volumes.
docker system prune -af --volumes