This repository has been archived by the owner on Sep 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from sasensi/master
Add a way to install with docker
- Loading branch information
Showing
5 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
APP_NAME=Laravel | ||
APP_ENV=local | ||
APP_KEY= | ||
APP_DEBUG=true | ||
APP_LOG_LEVEL=debug | ||
APP_URL=http://localhost | ||
|
||
DB_CONNECTION=mysql | ||
DB_HOST=mysql | ||
DB_PORT=3306 | ||
DB_DATABASE=db | ||
DB_USERNAME=user | ||
DB_PASSWORD=password | ||
|
||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=file | ||
SESSION_DRIVER=file | ||
QUEUE_DRIVER=sync | ||
|
||
# Set the allowed domains for CORS. | ||
# Separate each one by a comma. | ||
# Remove or comment to allow all origins. | ||
|
||
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:4200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
version: '3.1' | ||
services: | ||
|
||
php: | ||
build: | ||
context: ./php | ||
volumes: | ||
- ../:/app | ||
working_dir: /app | ||
ports: | ||
- 8000:8000 | ||
|
||
mysql: | ||
image: mysql | ||
environment: | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: db | ||
MYSQL_USER: user | ||
MYSQL_PASSWORD: password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM php:7.1-fpm | ||
|
||
RUN docker-php-ext-install pdo_mysql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ This repo is functionality complete — PRs and issues welcome! | |
|
||
Please check the official laravel installation guide for server requirements before you start. [Official Documentation](https://laravel.com/docs/5.4/installation#installation) | ||
|
||
Alternative installation is possible without local dependencies relying on [Docker](#docker). | ||
|
||
Clone the repository | ||
|
||
|
@@ -78,6 +79,26 @@ Run the database seeder and you're done | |
***Note*** : It's recommended to have a clean database before seeding. You can refresh your migrations at any point to clean the database by running the following command | ||
|
||
php artisan migrate:refresh | ||
|
||
## Docker | ||
|
||
To install with [Docker](https://www.docker.com), run following commands: | ||
|
||
``` | ||
git clone [email protected]:gothinkster/laravel-realworld-example-app.git | ||
cd laravel-realworld-example-app | ||
cp .env.example.docker .env | ||
docker run -v $(pwd):/app composer install | ||
cd ./docker | ||
docker-compose up -d | ||
docker-compose exec php php artisan key:generate | ||
docker-compose exec php php artisan jwt:generate | ||
docker-compose exec php php artisan migrate | ||
docker-compose exec php php artisan db:seed | ||
docker-compose exec php php artisan serve --host=0.0.0.0 | ||
``` | ||
|
||
The api can be accessed at [http://localhost:8000/api](http://localhost:8000/api). | ||
|
||
## API Specification | ||
|
||
|