From bd5b23a1b1a7c5d0a59cb8fca5cdede9964bfbd1 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Fri, 6 Oct 2023 20:02:16 +0800 Subject: [PATCH] dockerfile cleanup --- .dockerignore | 2 ++ Dockerfile-sdk => Dockerfile | 26 +++++--------------------- 2 files changed, 7 insertions(+), 21 deletions(-) create mode 100644 .dockerignore rename Dockerfile-sdk => Dockerfile (52%) diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..d499b6c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +Dockerfile +node_modules diff --git a/Dockerfile-sdk b/Dockerfile similarity index 52% rename from Dockerfile-sdk rename to Dockerfile index a959a0c..c542015 100644 --- a/Dockerfile-sdk +++ b/Dockerfile @@ -21,34 +21,18 @@ RUN \ && npm config -g set prefix ${NPM_GLOBAL} \ && su ${USERNAME} -c "npm config -g set prefix ${NPM_GLOBAL}" \ # Install eslint - && su ${USERNAME} -c "umask 0002 && npm install -g eslint lerna jest" \ + && su ${USERNAME} -c "umask 0002 && npm install -g eslint" \ && npm cache clean --force > /dev/null 2>&1 -# [Optional] Uncomment this section to install additional OS packages. -# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ -# && apt-get -y install --no-install-recommends - -# [Optional] Uncomment if you want to install an additional version of node using nvm -# ARG EXTRA_NODE_VERSION=10 -# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}" - -# [Optional] Uncomment if you want to install more global node modules -# RUN su node -c "npm install -g " - WORKDIR / -RUN mkdir node_modules && mkdir proto && mkdir scripts && mkdir src -COPY node_modules ./node_modules/ -COPY proto . ./proto/ -COPY scripts ./scripts/ -COPY src ./src/ COPY entrypoint.sh . ENTRYPOINT ["/entrypoint.sh"] -# Placeholder CMD : generally this will be overridden at run time like : -# docker run -it -v /home/builder/cerc/laconic-sdk:/workspace cerc/builder-js sh -c 'cd /workspace && yarn && yarn build' CMD node --version -# Temp hack, clone the laconic-sdk repo here -WORKDIR /app +WORKDIR /app/laconic-sdk + +COPY package*.json . RUN yarn install +COPY . . WORKDIR /app/laconic-sdk