Skip to content

Commit 76c96b3

Browse files
authored
Merge pull request #998 from meilisearch/cursor/slim-docker-dev-image
Use smaller dev image and store dependencies in Docker
2 parents 4c059bf + f36df76 commit 76c96b3

5 files changed

Lines changed: 28 additions & 8 deletions

File tree

‎.dockerignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!docker/
3+
!docker/java.Dockerfile

‎AGENTS.md‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
This repository provides a `docker-compose.yml` that lets you develop and run tests without installing Java locally.
44

5-
To speed up local development, always use Docker Compose with the `-v gradle-cache:/root/.gradle` option to **persist the Gradle cache across Docker runs**.
6-
75
## Commands
86

97
- `docker compose run --rm package bash -c "bash ./scripts/lint.sh"` - lint code

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ You can set up your local environment natively or using `docker`, check out the
4444

4545
Example of running all the checks with docker:
4646
```bash
47-
docker-compose run --rm package bash -c "./gradlew build && ./gradlew build integrationTest"
47+
docker compose run --rm package bash -c "./gradlew build && ./gradlew build integrationTest"
4848
```
4949

5050
To install dependencies:

‎docker-compose.yml‎

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
11
services:
22
package:
3-
image: azul/zulu-openjdk:17-latest
3+
build:
4+
context: .
5+
dockerfile: docker/java.Dockerfile
6+
image: meilisearch-java-dev
47
tty: true
58
stdin_open: true
69
working_dir: /home/package
710
environment:
811
- MEILISEARCH_HOST=http://meilisearch:7700
12+
- GRADLE_USER_HOME=/root/.gradle
913
depends_on:
1014
- meilisearch
11-
links:
12-
- meilisearch
1315
volumes:
1416
- ./:/home/package
17+
# Hide the host project cache.
18+
- package_gradle_project:/home/package/.gradle
19+
# Keep Gradle modules in Docker. Native binaries stay in this volume.
20+
- package_gradle:/root/.gradle
1521

1622
meilisearch:
17-
image: getmeili/meilisearch-enterprise:latest
23+
image: getmeili/meilisearch-enterprise:v1.55
1824
ports:
19-
- "7700"
25+
- "7700:7700"
2026
environment:
2127
- MEILI_MASTER_KEY=masterKey
2228
- MEILI_NO_ANALYTICS=true
29+
- MEILI_EXPERIMENTAL_ALLOWED_IP_NETWORKS=any
30+
31+
volumes:
32+
package_gradle:
33+
package_gradle_project:

‎docker/java.Dockerfile‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM azul/zulu-openjdk-alpine:17
2+
3+
# GNU xargs is required by the Gradle wrapper. Bash runs lint and Compose commands.
4+
RUN apk add --no-cache bash ca-certificates findutils git
5+
6+
WORKDIR /home/package
7+
8+
CMD ["bash"]

0 commit comments

Comments
 (0)