https://github.com/w3labkr/docker-lamp-stack
A basic LAMP stack environment built using Docker Compose.
https://github.com/w3labkr/docker-lamp-stack
apache docker docker-compose lamp mariadb mysql php redis
Last synced: 6 months ago
JSON representation
A basic LAMP stack environment built using Docker Compose.
- Host: GitHub
- URL: https://github.com/w3labkr/docker-lamp-stack
- Owner: w3labkr
- License: mit
- Created: 2025-02-19T10:29:04.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2025-02-20T07:22:48.000Z (10 months ago)
- Last Synced: 2025-02-20T08:22:00.740Z (10 months ago)
- Topics: apache, docker, docker-compose, lamp, mariadb, mysql, php, redis
- Language: Dockerfile
- Homepage:
- Size: 70.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# docker-lamp-stack
A basic LAMP stack environment built using Docker Compose. It consists of the following:
- PHP
- Apache
- MySQL
- Mariadb
- Redis
## Installation
Build and Run the Containers
```shell
git clone https://github.com/w3labkr/docker-lamp-stack.git docker
cd docker
cp .env.example .env
docker compose up -d
```
Register crontab and rebuild services
```shell
$ cp docker-entrypoint.sh bin//docker-entrypoint.sh
$ docker compose up -d --build
```
## Usage
Create and start containers
- `-d`: Detached mode: Run containers in the background
```shell
docker compose up -d
```
Build or rebuild services
```shell
docker compose up --build
```
Stop and remove containers, networks
```shell
docker compose down
```
Restart service containers
```shell
docker compose restart apache2
```
Execute a command in a running container
```shell
docker compose exec apache2 bash
exit
```
Execute a command in a running container
```shell
docker compose exec mariadb bash
mysql -uroot -psecret
show databases;
select Host, User from mysql.user;
exit
```
Force-remove a running container (--force)
```shell
docker container rm -f $(docker container ls -aq)
```
Remove one or more images
- `-f`: Filter output based on conditions provided
- `-q`: Only show image IDs
```shell
docker image rm -f $(docker image ls -q)
```
Do not use cache when building the image
```shell
docker compose build --no-cache
```
Remove unused data
```shell
docker system prune -a
```
## Reference
- [sprintcube/docker-compose-lamp](https://github.com/sprintcube/docker-compose-lamp)
- [robertsaupe/docker-compose-lamp](https://github.com/robertsaupe/docker-compose-lamp)
- [laradock](https://github.com/laradock/laradock)
## License
[MIT LICENSE](LICENSE)