-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refacto docker #2178
Refacto docker #2178
Conversation
28fdc8c
to
a67a540
Compare
Can I use this Dockerfile with 0.25.2 safely? I'm not sure what changes are in the 0.26.0 release of MeiliSearch but I need to use this and so far it seems to have solved meilisearch/meilisearch-kubernetes#95 for (the Pod is running but I'm not sure of any internal changes that might have ocurred) |
Yes but you'll need to rebuild the image yourself. git checkout v0.25.2
git checkout refacto-docker -- Dockerfile
docker build . # name your image and everything |
Yup, that's what I did exactly! |
Dockerfile
Outdated
COPY --from=compiler /meilisearch/target/release/meilisearch /bin/meilisearch | ||
|
||
# We want user to mount this directory as a volume | ||
RUN mkdir /data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'm not really sure what's going on here, we make a directory first but then also tag it as our working directory.
If we're marking this as our WD then we don't need to make the directory first, it's just an implicit step iirc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh cool, I didn't know that!
Thanks 馃憤
Hey, I created a new image for you and everyone who wants to test this PR with the v0.25.2. |
d8bf637
to
25b0a83
Compare
- Move the meilisearch binary to `/bin/meilisearch` so it's always in scope. - Create a `meili_data` directory used as the default working directory
25b0a83
to
683206e
Compare
bors merge |
closes #2166 and #2085
I noticed many people had issues with the default configuration of our Dockerfile.
Some examples:
data.ms
in a volume (as shown in the doc), you can't run meilisearchdata.ms
when loading a dump because it's the mount pointCurrently, we don't show how to use the snapshot and dumps with docker in the documentation. And it's quite hard to do:
I think this PR solve the problem.
Now the image contains the
meilisearch
binary in the/bin
directory, so it's easy to find and always in thePATH
.It creates a
data
directory and moves the working-dir in it.So now you can find the
dumps
,snapshots
anddata.ms
directory in/data
.Here is the new command to run meilisearch with a volume:
And if you need to import a dump or a snapshot, you don't need to restart your container and mount another volume. You can directly hit the
POST /dumps
route and then run:You can already try this PR with the following docker image:
If you want to use the v0.25.2 I created another image;
If you're using helm I created a branch here that use the v0.26.0 image with the good volume 馃憤
If you use this conf with the v0.25.2, it should also work.