https://github.com/keithmifsud/lemp-docker-demo
A demo for running a LEMP stack in Docker
https://github.com/keithmifsud/lemp-docker-demo
Last synced: 4 months ago
JSON representation
A demo for running a LEMP stack in Docker
- Host: GitHub
- URL: https://github.com/keithmifsud/lemp-docker-demo
- Owner: keithmifsud
- Created: 2018-07-13T06:44:54.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-13T10:54:14.000Z (almost 7 years ago)
- Last Synced: 2025-01-09T01:12:38.620Z (6 months ago)
- Language: PHP
- Size: 178 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Lemp Docker Demo
A demo LEMP stack for Docker that works on Windows 10 HOME.
## Overview
This demo is a blank Laravel application which you can run and test out of the box using Docker.
## Laravel Environment Variables
### Database
```dotenv
DB_CONNECTION=mysql
DB_HOST=db
DB_PORT=3306
DB_DATABASE=test_db
DB_USERNAME=root
DB_PASSWORD=secret
```__Note:__ You will need to wait a few seconds or minutes before being able to run `php artisan migrate` commands from the app container. This is while mysql service is starting.
## Usage in a real development environment.
Copy and update the following files:
```
docker-compose.yml
app.docker
web.docker
vhost.conf
```Then simply `docker-compose up -d` to build the containers.
### Accessing the app container
First check the app container's name by running:
```bash
docker ps
```Assuming the container name is `lempdockerdemo_app_1` you can SSH into it:
```bash
docker exec -it lempdockerdemo_app_1 bash
```From here you can run `artisan` command and other commands such as `phpunit`. However, as it is, you cannot run `composer` commands from within the container. You can however, either install `composer` in the container or run it from your host machine.
### Stopping all running containers
```bash
docker-composer kill
```### Stop all Docker containers
```bash
docker stop $(docker ps -a -q)
```### Remove all Docker containers
```bash
docker rm $(docker ps -a -q)
```