-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dockerfile manifest for the influxdb script (#74)
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM node:18.13.0@sha256:d9061fd0205c20cd47f70bdc879a7a84fb472b822d3ad3158aeef40698d2ce36 as base | ||
|
||
WORKDIR /home/node | ||
COPY --chown=1000:1000 ./ ./ | ||
|
||
RUN apt-get update && apt-get install -y libusb-dev | ||
|
||
|
||
# 1000 is the uid and gid of the node user | ||
USER 1000 | ||
RUN mkdir -p /home/node/.npm | ||
RUN mkdir -p /home/node/node_modules | ||
|
||
WORKDIR /home/node | ||
|
||
RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \ | ||
--mount=type=cache,uid=1000,gid=1000,target=/home/node/node_modules \ | ||
npm ci && cp -r node_modules node_modules_cache | ||
|
||
# Folders in the cache are not visible in the container that's why we copy | ||
# them and then move them back. | ||
|
||
RUN rm -rf node_modules && mv node_modules_cache node_modules | ||
|
||
WORKDIR /home/node | ||
|
||
ENTRYPOINT [ "npm", "run", "influxdb" ] |