-
Notifications
You must be signed in to change notification settings - Fork 730
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
ARG NODE_JS_VERSION=${NODE_JS_VERSION:-18} | ||
FROM node:${NODE_JS_VERSION} | ||
|
||
ARG BUILDER_UID=1000 | ||
ARG BUILDER_GID=1000 | ||
ENV BUILDER_USER elastic | ||
ENV BUILDER_GROUP elastic | ||
|
||
# install zip util | ||
RUN apt-get clean -y && \ | ||
apt-get update -y && \ | ||
apt-get install -y zip | ||
|
||
# Set user permissions and directory | ||
RUN (id -g ${BUILDER_GID} || groupadd --system -g ${BUILDER_GID} ${BUILDER_GROUP}) \ | ||
&& (id -u ${BUILDER_UID} || useradd --system --shell /bin/bash -u ${BUILDER_UID} -g ${BUILDER_GID} -m elastic) \ | ||
&& mkdir -p /usr/src/elasticsearch-js \ | ||
&& chown -R ${BUILDER_UID}:${BUILDER_GID} /usr/src/ | ||
|
||
WORKDIR /usr/src/elasticsearch-js | ||
|
||
# run remainder of commands as non-root user | ||
USER ${BUILDER_UID}:${BUILDER_GID} | ||
|
||
# install dependencies | ||
COPY package.json . | ||
RUN npm install --production=false | ||
|
||
# copy project files | ||
COPY . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters