Secretprtay

Docker

Feb 1st, 2022 (edited)
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.43 KB | None | 0 0
  1. FROM ruby:3
  2.  
  3. RUN gem install "bundler:~>2.0" --no-document && \
  4.     gem update --system && \
  5.     gem cleanup
  6.  
  7. # NodeJS (https://github.com/nodejs/docker-node/blob/main/14/bullseye/Dockerfile)
  8.  
  9. ARG NODE_VERSION=16.13.0
  10. RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
  11.   && case "${dpkgArch##*-}" in \
  12.     amd64) ARCH='x64';; \
  13.     ppc64el) ARCH='ppc64le';; \
  14.     s390x) ARCH='s390x';; \
  15.     arm64) ARCH='arm64';; \
  16.     armhf) ARCH='armv7l';; \
  17.     i386) ARCH='x86';; \
  18.     *) echo "unsupported architecture"; exit 1 ;; \
  19.   esac \
  20.   # gpg keys listed at https://github.com/nodejs/node#release-keys
  21.   && set -ex \
  22.   && for key in \
  23.     4ED778F539E3634C779C87C6D7062848A1AB005C \
  24.     94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
  25.     74F12602B6F1C4E913FAA37AD3A89613643B6201 \
  26.     71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 \
  27.     8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
  28.     C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
  29.     C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \
  30.     DD8F2338BAE7501E3DD5AC78C273792F7D83545D \
  31.     A48C2BEE680E841632CD4E44F07496B3EB3C1762 \
  32.     108F52B48DB57BB0CC439B2997B01419BD92F80A \
  33.     B9E2F5981AA6E0CD28160D9FF13993A75599653C \
  34.   ; do \
  35.       gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \
  36.       gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
  37.   done \
  38.   && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
  39.   && curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
  40.   && gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
  41.   && grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
  42.   && tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
  43.   && rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
  44.   && ln -s /usr/local/bin/node /usr/local/bin/nodejs \
  45.   # smoke tests
  46.   && node --version \
  47.   && npm --version
  48.  
  49. ARG YARN_VERSION=1.22.17
  50. RUN set -ex \
  51.   && for key in \
  52.     6A010C5166006599AA17F08146C2130DFD2497F5 \
  53.   ; do \
  54.     gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \
  55.     gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
  56.   done \
  57.   && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz" \
  58.   && curl -fsSLO --compressed "https://yarnpkg.com/downloads/$YARN_VERSION/yarn-v$YARN_VERSION.tar.gz.asc" \
  59.   && gpg --batch --verify yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
  60.   && mkdir -p /opt \
  61.   && tar -xzf yarn-v$YARN_VERSION.tar.gz -C /opt/ \
  62.   && ln -s /opt/yarn-v$YARN_VERSION/bin/yarn /usr/local/bin/yarn \
  63.   && ln -s /opt/yarn-v$YARN_VERSION/bin/yarnpkg /usr/local/bin/yarnpkg \
  64.   && rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
  65.   # smoke test
  66.   && yarn --version
  67.  
  68. # App dependencies
  69.  
  70. RUN apt-get update -qq && \
  71.     DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends imagemagick libvips libvips-dev libvips-tools libpq-dev && \
  72.     rm -rf /var/lib/apt/lists/* /var/cache/apt
  73.  
  74. # App
  75.  
  76. WORKDIR /app
  77. COPY ./Gemfile* /app/
  78. COPY ./config/jumpstart/Gemfile /app/config/jumpstart/
  79. RUN bundle config --local without "staging production omit" && bundle install --jobs $(nproc) --retry 5
  80. COPY package.json yarn.lock /app/
  81. RUN yarn install
  82. COPY . /app
  83.  
  84. CMD ["bin/rails", "s", "-b", "0.0.0.0"]
  85.  
  86. EXPOSE 3000
Add Comment
Please, Sign In to add comment