Skip to content

Commit

Permalink
Update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
carisaelam committed Sep 3, 2024
1 parent b48f126 commit 5f5419d
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./
Expand Down Expand Up @@ -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"]
CMD ["./bin/rails", "server"]

0 comments on commit 5f5419d

Please # to comment.