sudo yum install -y php
sudo yum install -y php-zip php-xml php-gd
sudo yum install -y httpd
class Array #class so that this method is available for array. monkey patching | |
def flat_it | |
each_with_object([]) do |element, flattened| #traverse each element | |
flattened.push *(element.is_a?(Array) ? element.flat_it : element) #call method if Array, push to flattened if not array | |
end | |
end | |
end | |
#usage | |
[1,2,3,4,[1,2,3,4,[1,2,[44,34]]],5].flat_it |
#!/bin/bash | |
echo "GOT $1 $2" | |
sleep 4 | |
export DEBIAN_FRONTEND=noninteractive | |
apt update | |
echo "Install Apache2" | |
sleep 2 |
FROM ruby:2.6.3-alpine3.9 | |
RUN apk update && apk add libpq nodejs | |
ENV RAILS_ROOT /app | |
RUN mkdir -p $RAILS_ROOT | |
ENV BUNDLER_VERSION 2.0.2 | |
WORKDIR $RAILS_ROOT | |
RUN echo 'gem: --no-ri --no-rdoc' > ~/.gemrc | |
COPY Gemfile Gemfile | |
COPY Gemfile.lock Gemfile.lock | |
RUN apk add --virtual build-dependencies build-base gcc wget git postgresql-dev \ |
echo "{\"AWSEBDockerrunVersion\":\"1\",\"Image\":{\"Name\":\"$REPOSITORY_URI:$RELEASE_TAG\",\"Update\":\"true\"},\"Ports\":[{\"ContainerPort\":\"5000\"}],\"Logging\":\"/var/log\"}" > Dockerrun.aws.json |
find . -name "node_modules" -type d -prune | xargs du -chs |