Skip to content

Commit

Permalink
Fix Dockerfile to set WORKDIR before run npm install
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelomachado authored Oct 10, 2022
1 parent 1b3b132 commit 6bdb7f4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM node:16-slim

LABEL description="Triple Pattern Fragment Server."
# Install location
ENV dir /var/www/@ldf/server

Expand All @@ -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"]

0 comments on commit 6bdb7f4

Please sign in to comment.