-
Notifications
You must be signed in to change notification settings - Fork 260
/
Dockerfile
37 lines (29 loc) · 1.31 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM ruby:3.2.2-slim
# Add basic binaries
RUN apt-get update \
&& apt-get install -y curl g++ gcc libfontconfig libpq-dev make patch xz-utils chromium \
# Clean up the apt cache
&& rm -rf /var/lib/apt/lists/*
# Specify a major version of Node.js to download and install
ENV NODEJS_MAJOR_VERSION=16
# Download and extract Node.js from archive supplied by nodejs.org
RUN curl -L https://nodejs.org/dist/latest-v$NODEJS_MAJOR_VERSION\.x/SHASUMS256.txt -O \
&& ARCHIVE_FILENAME=$(grep -o "node-*.*.*-linux-x64.tar.xz" SHASUMS256.txt) \
&& curl -L https://nodejs.org/dist/latest-v$NODEJS_MAJOR_VERSION.x/$ARCHIVE_FILENAME -o nodejs.tar.xz \
&& tar xf nodejs.tar.xz \
&& mv ./node-v*-linux-x64 /usr/local/nodejs \
# Clean up the Node.js archive and SHASUMS256.txt
&& rm nodejs.tar.xz SHASUMS256.txt
# Add Node.js binaries to PATH (includes Node and NPM, will include Yarn)
ENV PATH="/usr/local/nodejs/bin/:${PATH}"
# Install Yarn
RUN npm install -g yarn
# Make the "/refugerestrooms" folder, run all subsequent commands in that folder
RUN mkdir /refugerestrooms
WORKDIR /refugerestrooms
# Install Ruby gems with Bundler
COPY Gemfile Gemfile.lock /refugerestrooms/
RUN bundle install
# Install Node.js packages with Yarn
COPY package.json yarn.lock /refugerestrooms/
RUN yarn install --pure-lockfile && yarn cache clean