From 5f5419da8c94a538d9f6139568e37f131645a20f Mon Sep 17 00:00:00 2001 From: carisaelam Date: Tue, 3 Sep 2024 09:13:01 -0400 Subject: [PATCH] Update dockerfile --- Dockerfile | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index b4d4517..27bd59e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,16 +30,14 @@ RUN apt-get update -qq && \ apt-get install --no-install-recommends -y build-essential git libpq-dev node-gyp pkg-config python-is-python3 && \ rm -rf /var/lib/apt/lists /var/cache/apt/archives -# Install Node.js and Yarn from official sources -RUN apt-get update -qq && \ - apt-get install --no-install-recommends -y nodejs=$NODE_VERSION npm=$YARN_VERSION && \ - rm -rf /var/lib/apt/lists /var/cache/apt/archives - -# Set PATH with Node.js bin directory -ENV PATH=/usr/local/node/bin:$PATH - # Install JavaScript dependencies -# (Remove the previous curl-based installation) +ARG NODE_VERSION=18.18.0 +ARG YARN_VERSION=1.22.22 +ENV PATH=/usr/local/node/bin:$PATH +RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz -C /tmp/ && \ + /tmp/node-build-master/bin/node-build "${NODE_VERSION}" /usr/local/node && \ + npm install -g yarn@$YARN_VERSION && \ + rm -rf /tmp/node-build-master # Install application gems COPY Gemfile Gemfile.lock ./ @@ -82,4 +80,4 @@ ENTRYPOINT ["/rails/bin/docker-entrypoint"] # Start the server by default, this can be overwritten at runtime EXPOSE 3000 -CMD ["./bin/rails", "server"] \ No newline at end of file +CMD ["./bin/rails", "server"]