Skip to content

Commit f9345c3

Browse files
Update
1 parent 26152c3 commit f9345c3

File tree

5 files changed

+100
-35
lines changed

5 files changed

+100
-35
lines changed

Makefile

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1+
# make init
12
init:
2-
cp .env_example .env;
3+
cp .env_example .env;
4+
5+
# make clear-all-logs
6+
clear-all-logs:
7+
for log in logs/**/*.log; do \
8+
cat /dev/null > $$log; \
9+
done
10+
11+
# make clear-logs-in folder=nginx
12+
clear-logs-in:
13+
for log in logs/$(folder)/*.log; do \
14+
cat /dev/null > $$log; \
15+
done
16+
17+
# make watch-log logFilePath=logs/nginx/backend-access.log
18+
watch-log:
19+
tail -f $(logFilePath);

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,28 @@ To install, you need to install docker locally.
88
- Simple and clear project structure;
99
- Php the latest version 8.1 (can be changed if you need);
1010
- All necessary php extensions including composer and xDebug3;
11-
- Output all necessary logs (nginx, php, mysql, redis), including slow mysql queries;
11+
- Output all necessary logs (nginx, php, mysql, redis, supervisor, cron), including slow mysql queries;
1212
- Supervisor and cron support
1313
- Quick, easy setup for everything you need
1414
- Lots of useful examples
1515

1616
### How start work
1717
First make sure you have [Docker](https://docs.docker.com/get-docker/) installed locally.
1818

19-
1. Clone current project:
20-
21-
`git clone https://github.com/krepysh-spec/lamp-docker-php-skeleton.git && cd lamp-docker-php-skeleton`
22-
2. Create .env file from .env_example:
23-
24-
`cp .env_example .env` and fill configuration in .env file
25-
26-
3. `docker-compose build && docker-compose up` and after open in browser [http://localhost](http://localhost)
19+
Clone current project:
20+
```bash
21+
git clone https://github.com/krepysh-spec/lamp-docker-php-skeleton.git && cd lamp-docker-php-skeleton
22+
````
23+
Create .env file from .env_example:
24+
```bash
25+
cp .env_example .env
26+
````
27+
Fill configuration in .env file
28+
```bash
29+
docker-compose build && docker-compose up
30+
```
31+
32+
After open in browser [http://localhost](http://localhost)
2733

2834
### Support
2935

docker-compose.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,17 @@ services:
2222
networks:
2323
- backend-network
2424

25+
redis-commander:
26+
image: rediscommander/redis-commander:latest
27+
container_name: "${DOCKER_PREFIX}-redis-commander"
28+
restart: always
29+
environment:
30+
- REDIS_HOSTS=local:redis
31+
ports:
32+
- "8081:8081"
33+
networks:
34+
- backend-network
35+
2536
mysql:
2637
image: mysql:latest
2738
container_name: "${DOCKER_PREFIX}-mysql"

docker/backend/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ RUN apt-get update && apt-get install -y \
77
unzip \
88
curl \
99
supervisor \
10-
cron
10+
cron \
11+
procps \
12+
htop
1113

1214
# Clear cache
1315
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

src/src/views/index.php

Lines changed: 53 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,41 +5,70 @@
55
<meta name="viewport"
66
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
77
<meta http-equiv="X-UA-Compatible" content="ie=edge">
8-
<title>Document</title>
8+
<title>Lamp Docker PHP skeleton</title>
99
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
1010
</head>
1111
<body>
12+
<div class="px-4 bg-dark text-secondary py-5 text-center">
13+
<h1 class="display-5 fw-bold text-white">Lamp Docker PHP skeleton</h1>
14+
<div class="col-lg-6 mx-auto">
15+
<p class="lead mb-4">Stop installing the entire development stack on your local machine. This project will allow you to quickly start working with php. To install, you need to install docker locally.</p>
16+
<div class="d-grid gap-2 d-sm-flex justify-content-sm-center">
17+
<a href="https://github.com/krepysh-spec/lamp-docker-php-skeleton" target="_blank" class="btn btn-default btn-lg px-4 gap-3">View on GitHub</a>
18+
</div>
19+
</div>
20+
</div>
1221
<div class="container mt-5">
1322
<div class="row">
1423
<div class="col-md-12">
15-
<ol class="list-group list-group-numbered">
16-
<li class="list-group-item d-flex justify-content-between align-items-start">
17-
<div class="ms-2 me-auto">
18-
<div class="fw-bold">Mysql</div>
19-
Content to database:
20-
</div>
21-
<span class="badge bg-primary rounded-pill"><?= $databaseConnectionStatus ? 'Success': 'Error' ?></span>
24+
<ul class="nav nav-tabs justify-content-center" id="myTab" role="tablist">
25+
<li class="nav-item" role="presentation">
26+
<button class="nav-link active" id="home-tab" data-bs-toggle="tab" data-bs-target="#home" type="button" role="tab" aria-controls="home" aria-selected="true">PHP info</button>
2227
</li>
23-
<li class="list-group-item d-flex justify-content-between align-items-start">
24-
<div class="ms-2 me-auto">
25-
<div class="fw-bold">Redis</div>
26-
Connect to redis:
27-
</div>
28-
<span class="badge bg-primary rounded-pill"><?= $redisConnectionStatus ? 'Success': 'Error' ?></span>
28+
<li class="nav-item" role="presentation">
29+
<button class="nav-link" id="profile-tab" data-bs-toggle="tab" data-bs-target="#profile" type="button" role="tab" aria-controls="profile" aria-selected="false">XDebug info</button>
2930
</li>
30-
</ol>
31+
<li class="nav-item" role="presentation">
32+
<button class="nav-link" id="contact-tab" data-bs-toggle="tab" data-bs-target="#contact" type="button" role="tab" aria-controls="contact" aria-selected="false">Mysql</button>
33+
</li>
34+
<li class="nav-item" role="presentation">
35+
<button class="nav-link" id="redis-tab" data-bs-toggle="tab" data-bs-target="#redis" type="button" role="tab" aria-controls="redis" aria-selected="false">Redis</button>
36+
</li>
37+
</ul>
38+
<div class="tab-content" id="myTabContent">
39+
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
40+
<?php phpinfo() ?>
41+
</div>
42+
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
43+
<?php xdebug_info() ?>
44+
</div>
45+
<div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">
46+
<ol class="list-group list-group-numbered">
47+
<li class="list-group-item d-flex justify-content-between align-items-start">
48+
<div class="ms-2 me-auto">
49+
<div class="fw-bold">Mysql</div>
50+
Content to database:
51+
</div>
52+
<span class="badge bg-primary rounded-pill"><?= $databaseConnectionStatus ? 'Success': 'Error' ?></span>
53+
</li>
54+
</ol>
55+
</div>
56+
<div class="tab-pane fade" id="redis" role="tabpanel" aria-labelledby="redis-tab">
57+
<ol class="list-group list-group-numbered">
58+
<li class="list-group-item d-flex justify-content-between align-items-start">
59+
<div class="ms-2 me-auto">
60+
<div class="fw-bold">Redis</div>
61+
Connect to redis:
62+
</div>
63+
<span class="badge bg-primary rounded-pill"><?= $redisConnectionStatus ? 'Success': 'Error' ?></span>
64+
</li>
65+
</ol>
66+
</div>
67+
</div>
3168
</div>
3269
</div>
3370
</div>
34-
<div class="container">
35-
<div class="row">
36-
<div class="col-md-6">
3771

38-
</div>
39-
<div class="col-md-6">
40-
41-
</div>
42-
</div>
43-
</div>
72+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
4473
</body>
4574
</html>

0 commit comments

Comments
 (0)