forked from Attendize/Attendize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (40 loc) · 1.97 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
# Commonly used commands, compatible with Linux type shells
# build the docker images for any environment
build:
docker build --tag attendize_base --target base .
docker build --tag attendize_worker --target worker --cache-from attendize_base:latest .
docker build --tag attendize_web --target web --cache-from attendize_worker:latest .
build-apache:
docker build --tag attendize_base --target base --file Dockerfile-apache .
docker build --tag attendize_worker --target worker --cache-from attendize_base:latest --file Dockerfile-apache .
docker build --tag attendize_web --target web --cache-from attendize_worker:latest --file Dockerfile-apache .
################
# The following commands are for local development use only and won't work in a production environment
################
# set up docker images and run containers for local development with docker-compose only
setup: build
cp .env.example .env
docker-compose up -d
docker-compose exec web sh -c 'wait-for-it db:3306 -t 180 && php artisan key:generate && php artisan migrate'
docker-compose up -d
docker-compose exec web sh -c 'wait-for-it web:443 -t 120'
open https://localhost:8081/install
docker-compose exec web tail -f /var/log/nginx/access.log /var/log/nginx/error.log /var/log/php-fpm.log storage/logs/*
# run the whole stack and open up the app in the browser
run:
docker-compose up -d
docker-compose exec web sh -c 'wait-for-it db:3306 -t 180'
docker-compose exec web sh -c 'wait-for-it web:443 -t 120'
open https://localhost:8081/
# open a bash prompt on a running web container
shell:
docker-compose exec web /bin/bash
# run the unit tests on a running web container
test:
docker-compose exec web bash -c "touch database/database.sqlite && vendor/bin/phpunit"
# clear all laravel caches on a running web container
cache:
docker-compose exec web php artisan optimize:clear
# clear and recompile the autoloder files, for example if you add a new class file
autoload:
docker-compose exec web composer dump-autoload