Skip to content

Commit

Permalink
fix: faster docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Datron committed Sep 9, 2024
1 parent 5baad41 commit a9afdb9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH="${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH}"
RUN node --version

RUN cargo install wasm-pack
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

COPY . .
RUN npm ci --loglevel=info

Expand Down
8 changes: 4 additions & 4 deletions example.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /build

# install nodeJS for functions
ENV NVM_DIR /usr/local/nvm

Check warning on line 6 in example.Dockerfile

View workflow job for this annotation

GitHub Actions / docker

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/
ENV NODE_VERSION 18.19.0
ENV NODE_VERSION 20.17.0

Check warning on line 7 in example.Dockerfile

View workflow job for this annotation

GitHub Actions / docker

Legacy key/value format with whitespace separator should not be used

LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format More info: https://docs.docker.com/go/dockerfile/rule/legacy-key-value-format/

RUN mkdir -p $NVM_DIR
RUN curl "https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh" | bash \
Expand All @@ -17,10 +17,10 @@ ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH="${NVM_DIR}/versions/node/v${NODE_VERSION}/bin/:${PATH}"
RUN node --version

RUN cargo install wasm-pack
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

COPY . .
RUN npm ci --loglevel=info
RUN npm ci --loglevel=info --maxsockets 1
RUN cd crates/context_aware_config/ && npm ci
RUN mkdir -p target/node_modules
RUN cp -a crates/context_aware_config/node_modules target/
Expand All @@ -41,7 +41,7 @@ RUN cargo build --release

FROM debian:bookworm-slim as runtime

Check warning on line 42 in example.Dockerfile

View workflow job for this annotation

GitHub Actions / docker

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

ENV NODE_VERSION=18.19.0
ENV NODE_VERSION=20.17.0
WORKDIR /app

RUN apt-get update && apt-get install -y libpq5 ca-certificates curl supervisor
Expand Down

0 comments on commit a9afdb9

Please sign in to comment.