Skip to content
This repository was archived by the owner on Feb 18, 2023. It is now read-only.

Commit 4ee0f79

Browse files
author
joselfonseca
committed
Add docker
1 parent 40c1798 commit 4ee0f79

File tree

5 files changed

+51
-1
lines changed

5 files changed

+51
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ Homestead.json
1313
.idea/
1414
.DS_Store
1515
.phpunit.result.cache
16+
docker/mysql/

app/Exceptions/Handler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace App\Exceptions;
44

5-
use Throwable;
65
use Illuminate\Auth\AuthenticationException;
76
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
7+
use Throwable;
88

99
/**
1010
* Class Handler.

bin/exec-app-container.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
set -x #echo on
4+
5+
docker-compose -f docker-compose.yml exec app /bin/bash

bin/run-scheduler.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
while [ true ]
4+
do
5+
php /var/www/html/artisan schedule:run --quiet --no-interaction &
6+
sleep 60
7+
done

docker-compose.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: '3'
2+
services:
3+
app:
4+
image: joselfonsecadt/nginx-php7.4-dev:latest
5+
volumes:
6+
- ./:/var/www/html
7+
ports:
8+
- 80:80
9+
networks:
10+
- api
11+
scheduler:
12+
image: joselfonsecadt/nginx-php7.4-dev:latest
13+
command: ./var/www/html/bin/run-scheduler.sh
14+
volumes:
15+
- ./:/var/www/html
16+
networks:
17+
- api
18+
mysql:
19+
image: mysql:5.7
20+
environment:
21+
MYSQL_ROOT_PASSWORD: secret
22+
MYSQL_DATABASE: api
23+
volumes:
24+
- ./docker/mysql/data/:/var/lib/mysql
25+
ports:
26+
- 3306:3306
27+
networks:
28+
- api
29+
redis:
30+
image: redis:5-alpine
31+
ports:
32+
- 6379:6379
33+
networks:
34+
- api
35+
networks:
36+
api:
37+
driver: bridge

0 commit comments

Comments
 (0)