Last active
December 4, 2018 22:35
-
-
Save scottserok/8d1d585c2b829956ad2ba879af769b9c to your computer and use it in GitHub Desktop.
Dockerfile for AWS Serverless Ruby 2.5.3 with PG driver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM amazonlinux | |
LABEL maintainer="scott@serok.us" | |
RUN yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-redhat10-10-2.noarch.rpm | |
RUN sed -i "s/rhel-\$releasever-\$basearch/rhel-latest-x86_64/g" "/etc/yum.repos.d/pgdg-10-redhat.repo" | |
RUN yum install -y gcc openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel ruby-devel gcc-c++ jq git patch which tar procps make glibc-devel postgresql10 postgresql-devel | |
RUN curl https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.3.tar.gz > ruby-2.5.3.tar.gz | |
RUN tar -xvzf ruby-2.5.3.tar.gz | |
RUN cd ruby-2.5.3 && ./configure && make && make install | |
RUN gem install bundler --no-rdoc --no-ri | |
WORKDIR /app | |
COPY . . | |
RUN mkdir -p vendor/opt/libpq | |
RUN cp /usr/pgsql-10/lib/libpq.so.5 vendor/opt/libpq/ | |
RUN bundle config --local build.pg --with-opt-dir="/app/vendor/opt/libpq" | |
RUN bundle install && bundle install --deployment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment