mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08:00
Creates non root user to run Meilisearch in Dockerfile
This commit is contained in:
parent
81993b6a15
commit
4009804221
14
Dockerfile
14
Dockerfile
@ -35,12 +35,18 @@ RUN $HOME/.cargo/bin/cargo build --release
|
|||||||
# Run
|
# Run
|
||||||
FROM alpine:3.14
|
FROM alpine:3.14
|
||||||
|
|
||||||
RUN apk add -q --no-cache libgcc tini curl
|
ARG USER=meiliuser
|
||||||
|
ENV HOME /home/$USER
|
||||||
|
ENV MEILI_HTTP_ADDR 0.0.0.0:7700
|
||||||
|
|
||||||
|
# download runtime deps as root and create $USER
|
||||||
|
RUN apk add -q --no-cache libgcc tini curl \
|
||||||
|
&& adduser -D $USER
|
||||||
|
WORKDIR $HOME
|
||||||
|
USER $USER
|
||||||
|
# copy file as $USER to $HOME
|
||||||
COPY --from=compiler /meilisearch/target/release/meilisearch .
|
COPY --from=compiler /meilisearch/target/release/meilisearch .
|
||||||
|
|
||||||
ENV MEILI_HTTP_ADDR 0.0.0.0:7700
|
|
||||||
EXPOSE 7700/tcp
|
EXPOSE 7700/tcp
|
||||||
|
|
||||||
ENTRYPOINT ["tini", "--"]
|
CMD ["tini", "--","./meilisearch"]
|
||||||
CMD ./meilisearch
|
|
||||||
|
Loading…
Reference in New Issue
Block a user