Skip to content

Commit

Permalink
Install nodejs in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
mnishiguchi committed May 8, 2022
1 parent 836f487 commit 2b4072f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ FROM ${BUILDER_IMAGE} as builder

# install build dependencies
RUN apt-get update -y && apt-get install -y build-essential git \
&& apt-get install -y curl \
&& curl -sL https://deb.nodesource.com/setup_16.x | bash \
&& apt-get install -y nodejs \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*

# prepare build dir
Expand All @@ -46,12 +49,19 @@ RUN mkdir config
COPY config/config.exs config/${MIX_ENV}.exs config/
RUN mix deps.compile

# install npm dependencies
COPY assets/package.json assets/package-lock.json ./assets/
RUN npm --prefix ./assets ci --progress=false --no-audit --loglevel=error

COPY priv priv

COPY lib lib

COPY assets assets

# Install NPM dependencies
RUN npm install --prefix assets

# compile assets
RUN mix assets.deploy

Expand Down

0 comments on commit 2b4072f

Please sign in to comment.