Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added meilisearch feature #292

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ A basic LAMP stack environment built using Docker Compose. It consists of the fo
- MySQL
- phpMyAdmin
- Redis
- Meilisearch

As of now, we have several different PHP versions. Use appropriate php version as needed:

Expand Down
9 changes: 9 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,12 @@ services:
image: redis:latest
ports:
- "127.0.0.1:${HOST_MACHINE_REDIS_PORT}:6379"
meilisearch:
container_name: "${COMPOSE_PROJECT_NAME}-meilisearch"
image: getmeili/meilisearch:latest
ports:
- "127.0.0.1:${HOST_MACHINE_MEILISEARCH_PORT}:7700"
environment:
MEILI_MASTER_KEY: ${MEILI_MASTER_KEY}
volumes:
- ${MEILISEARCH_DATA_DIR-./data/meilisearch}:/meili_data
5 changes: 5 additions & 0 deletions sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@ MYSQL_ROOT_PASSWORD=tiger
MYSQL_USER=docker
MYSQL_PASSWORD=docker
MYSQL_DATABASE=docker

# Meilisearch settings: port, key & directory
HOST_MACHINE_MEILISEARCH_PORT=7700
MEILI_MASTER_KEY=your_master_key_here
MEILISEARCH_DATA_DIR=./data/meilisearch
18 changes: 18 additions & 0 deletions www/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,24 @@
mysqli_close($link);
?>
</li>
<li>
<?php
// Check Meilisearch status
$meiliUrl = "http://localhost:" . getenv('HOST_MACHINE_MEILISEARCH_PORT');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $meiliUrl . "/health");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpcode == 200) {
echo "Meilisearch is running!";
} else {
echo "Meilisearch is not available!";
}
?>
</li>
</ul>
</div>
</div>
Expand Down