https://github.com/ega4432/lara-docker
:whale: Build the docker containers for Laravel local environment
https://github.com/ega4432/lara-docker
docker docker-compose github-actions lara-docker laravel laravel-environment mysql nginx php
Last synced: 3 months ago
JSON representation
:whale: Build the docker containers for Laravel local environment
- Host: GitHub
- URL: https://github.com/ega4432/lara-docker
- Owner: ega4432
- Created: 2019-12-03T13:07:57.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-01T12:48:26.000Z (about 6 years ago)
- Last Synced: 2025-08-10T03:36:56.620Z (11 months ago)
- Topics: docker, docker-compose, github-actions, lara-docker, laravel, laravel-environment, mysql, nginx, php
- Language: Dockerfile
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lara-docker

## Overview
This is a repository for building Laravel environment with docker (docker-compose).
The base container image of the software used and its version are as follows.
| Software | base container image |
| :---: | :---: |
| php | [7.3-fpm-alpine](https://hub.docker.com/_/php) |
| mysql | [8.0](https://hub.docker.com/_/mysql) |
| nginx | [1.17-alpine](https://hub.docker.com/_/nginx) |
| redis | [5.0-alpine](https://hub.docker.com/_/redis) |
| node | [13.10-alpine](https://hub.docker.com/_/node) |
## Setup
### Requirements
```
❯ docker -v
Docker version 19.03.5, build 633a0ea
❯ docker-compose -v
docker-compose version 1.24.1, build 4667896b
```
### Build and Up
```
❯ docker-compose build
❯ docker-compose up -d
```
or
```
❯ docker-compose up -d --build
```
### Excute command
```
❯ docker-compose exec app [ service name ] ash [ command ( ex: php -v ) ]
```
### Stop and Remove containers
```
❯ docker-compose down
```
## Install Laravel
```
❯ docker-compose exec app ash
/work # composer create-project --prefer-dist "laravel/laravel=6.0.*" .
/work # php artisan -V
Laravel Framework 6.6.1
```
## Supplements
### Connect to MySQL
```
$ docker-compose exec db bash -c 'mysql -uroot -p${MYSQL_PASSWORD} ${MYSQL_DATABASE}'
```