-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
30 lines (22 loc) · 799 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
# Define the name of the docker-compose file
DOCKER_COMPOSE_FILE = docker-compose.yml
# Define the name of the docker-compose service
DOCKER_COMPOSE_SERVICE = mongodb
# Start the container in detached mode
up:
docker-compose -f $(DOCKER_COMPOSE_FILE) up -d $(DOCKER_COMPOSE_SERVICE)
# Stop the container
down:
docker-compose -f $(DOCKER_COMPOSE_FILE) down --remove-orphans
# Restart the container
restart:
docker-compose -f $(DOCKER_COMPOSE_FILE) restart $(DOCKER_COMPOSE_SERVICE)
# Display the logs from the container
logs:
docker-compose -f $(DOCKER_COMPOSE_FILE) logs -f $(DOCKER_COMPOSE_SERVICE)
# Run a command inside the container
exec:
docker-compose exec mongodb sh
# docker prune: used to clear all the stale containers, images, volumes, networks
prune:
docker system prune -a