From 6bdb7f4af0af003213c4765065961ca77594aa63 Mon Sep 17 00:00:00 2001 From: Marcelo Machado Date: Mon, 10 Oct 2022 05:01:17 -0300 Subject: [PATCH] Fix Dockerfile to set WORKDIR before run npm install --- packages/server/Dockerfile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/server/Dockerfile b/packages/server/Dockerfile index 4eeff067..96133911 100644 --- a/packages/server/Dockerfile +++ b/packages/server/Dockerfile @@ -1,5 +1,5 @@ FROM node:16-slim - +LABEL description="Triple Pattern Fragment Server." # Install location ENV dir /var/www/@ldf/server @@ -16,16 +16,18 @@ RUN npm config set @ldf:registry $NPM_REGISTRY # Install the node module RUN apt-get update && \ apt-get install -y g++ make python && \ - cd ${dir} && npm install --only=production && \ - apt-get remove -y g++ make python && apt-get autoremove -y && \ + cd ${dir} + +WORKDIR ${dir} +RUN npm install --only=production +RUN apt-get remove -y g++ make python && apt-get autoremove -y && \ rm -rf /var/cache/apt/archives # Expose the default port EXPOSE 3000 # Run base binary -WORKDIR ${dir} ENTRYPOINT ["node", "bin/ldf-server"] # Default command -CMD ["--help"] +CMD ["--help"] \ No newline at end of file