enhance docker scripts
This commit is contained in:
34
Makefile
34
Makefile
@@ -1,20 +1,32 @@
|
||||
all:
|
||||
run
|
||||
DOCKER_CONTAINER_NAME=awa-laravel-1
|
||||
DOCKER_CMD=docker exec -it $(DOCKER_CONTAINER_NAME)
|
||||
|
||||
# Launch the container detached
|
||||
all:
|
||||
docker compose up -d
|
||||
|
||||
# Launch the container
|
||||
run:
|
||||
docker compose up
|
||||
|
||||
init_vendor:
|
||||
cd laravel && composer i
|
||||
|
||||
init:
|
||||
docker exec -i awa-laravel-1 /scripts/init_laravel.sh
|
||||
|
||||
exec_container:
|
||||
docker exec -i awa-laravel-1 bash
|
||||
# Stop the container
|
||||
stop:
|
||||
docker compose down
|
||||
|
||||
# Stop the container and wipe the database
|
||||
down:
|
||||
docker compose down -v
|
||||
|
||||
|
||||
|
||||
|
||||
# These tasks need the docker container to be running
|
||||
|
||||
exec_container:
|
||||
$(DOCKER_CMD) bash
|
||||
|
||||
seed:
|
||||
docker exec -i awa-laravel-1 php artisan db:seed --class=$(CLASS)
|
||||
$(DOCKER_CMD) php artisan db:seed --class=$(CLASS)
|
||||
|
||||
migrate:
|
||||
$(DOCKER_CMD) php artisan migrate
|
||||
Reference in New Issue
Block a user