From 683206e140d1ceb46d1fe90aab5b920c6a64f1c3 Mon Sep 17 00:00:00 2001 From: Tamo Date: Sat, 9 Apr 2022 00:27:36 +0200 Subject: [PATCH] feat(docker): refactoring the dockerfile - Move the meilisearch binary to `/bin/meilisearch` so it's always in scope. - Create a `meili_data` directory used as the default working directory --- Dockerfile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ee0d62ce4..ad21329fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,9 +27,20 @@ ENV MEILI_SERVER_PROVIDER docker RUN apk update --quiet \ && apk add -q --no-cache libgcc tini curl -COPY --from=compiler /meilisearch/target/release/meilisearch . +# add meilisearch to the `/bin` so you can run it from anywhere and it's easy +# to find. +COPY --from=compiler /meilisearch/target/release/meilisearch /bin/meilisearch +# To stay compatible with the older version of the container (pre v0.27.0) we're +# going to symlink the meilisearch binary in the path to `/meilisearch` +RUN ln -s /bin/meilisearch /meilisearch + +# This directory should hold all the data related to meilisearch so we're going +# to move our PWD in there. +# We don't want to put the meilisearch binary +WORKDIR /meili_data + EXPOSE 7700/tcp ENTRYPOINT ["tini", "--"] -CMD ./meilisearch +CMD /bin/meilisearch