You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@docker version > /dev/null 2>&1 || (echo "" && echo "Error: Docker is not running. Please make sure Docker is installed and running." && echo "" && exit 1)
26
+
endif
27
+
28
+
# Check if the .env file exists, if not, copy from .env.dist
29
+
# This target ensures that the .env file is present by copying it from .env.dist if it doesn't exist.
30
+
check-env:
31
+
ifeq ($(SHELLTYPE),windows)
32
+
@if not exist .env ( \
33
+
echo The .env file does not exist. Copying from .env.dist... && \
34
+
copy .env.dist .env \
35
+
) 2>nul
36
+
else
37
+
@if [ ! -f .env ]; then \
38
+
echo "The .env file does not exist. Copying from .env.dist..."; \
39
+
cp .env.dist .env; \
40
+
fi
41
+
endif
42
+
43
+
# Start Docker containers in interactive mode
44
+
# This target builds and starts the Docker containers, allowing interaction with the terminal.
45
+
up: check-docker
46
+
docker compose up --build
47
+
48
+
# Start Docker containers in background mode (daemon)
49
+
# This target builds and starts the Docker containers in the background.
50
+
upd: check-docker
51
+
docker compose up -d
52
+
53
+
# Stop and remove Docker containers
54
+
# This target stops and removes all running Docker containers.
55
+
down: check-docker
56
+
docker compose down
57
+
58
+
# Pull the latest images from the registry
59
+
# This target pulls the latest Docker images from the registry.
60
+
pull: check-docker
61
+
docker compose -f docker-compose.yml pull
62
+
63
+
# Build or rebuild Docker containers
64
+
# This target builds or rebuilds the Docker containers.
65
+
build: check-docker
66
+
docker compose build
67
+
68
+
# Open a shell inside the moodle container
69
+
# This target opens an interactive shell session inside the running Moodle container.
70
+
shell: check-docker
71
+
docker compose exec moodle sh
72
+
73
+
# Clean up and stop Docker containers, removing volumes and orphan containers
74
+
# This target stops all containers and removes them along with their volumes and any orphan containers.
0 commit comments