mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-30 00:34:26 +01:00
Merge #1759
1759: Feature docker as non root r=curquiza a=igaul This closes #1757 . Adding a non root user with default name meiliuser. Co-authored-by: gaul@pdx.edu <gaul@pdx.edu> Co-authored-by: igaul <40813772+igaul@users.noreply.github.com> Co-authored-by: Clémentine Urquizar <clementine@meilisearch.com>
This commit is contained in:
commit
d107b3f46c
11
Dockerfile
11
Dockerfile
@ -35,11 +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=meili
|
||||||
|
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", "--"]
|
ENTRYPOINT ["tini", "--"]
|
||||||
|
Loading…
Reference in New Issue
Block a user