|
| 1 | +FROM ubuntu:focal |
| 2 | + |
| 3 | +# Set a directory for the app |
| 4 | +WORKDIR /app |
| 5 | + |
| 6 | +# Update APT |
| 7 | +RUN apt-get update |
| 8 | + |
| 9 | +# Install curl |
| 10 | +RUN apt-get install -y curl |
| 11 | + |
| 12 | +# Install node.js v16 |
| 13 | +RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - |
| 14 | +RUN apt-get install -y nodejs |
| 15 | + |
| 16 | +# Install build-essentials (required for certain npm packages) |
| 17 | +RUN apt-get install -y build-essential |
| 18 | + |
| 19 | +# Install grunt, jsonlint and jshint |
| 20 | +RUN npm install -g grunt |
| 21 | + |
| 22 | +# Install latest stable Ruby |
| 23 | +RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import |
| 24 | +RUN curl -sSL https://rvm.io/pkuczynski.asc | gpg --import |
| 25 | +RUN curl -sSL https://get.rvm.io | bash -s stable --ruby |
| 26 | + |
| 27 | +# Update Gem |
| 28 | +RUN bash -c "source /etc/profile.d/rvm.sh && gem update --system" |
| 29 | + |
| 30 | +# Install compass |
| 31 | +RUN bash -c "source /etc/profile.d/rvm.sh && gem install compass" |
| 32 | + |
| 33 | +# Copy over package*.json files |
| 34 | +COPY package*.json ./ |
| 35 | + |
| 36 | +# Install our NPM dependencies |
| 37 | +RUN npm install --legacy-peer-deps |
| 38 | + |
| 39 | +# Preserve package-lock.json |
| 40 | +RUN cp package-lock.json package-lock.json.new |
| 41 | + |
| 42 | +# Copy all the files to the container |
| 43 | +COPY . . |
| 44 | + |
| 45 | +# Restore package-lock.json |
| 46 | +RUN cp package-lock.json.new package-lock.json |
| 47 | + |
| 48 | +# Finally, run the build script on run |
| 49 | +ENV grunt_command default |
| 50 | +CMD ["bash", "-c", "source /etc/profile.d/rvm.sh && grunt ${grunt_command}"] |
0 commit comments