Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
install pyenv and rvm
  • Loading branch information
guykisel committed Jul 21, 2017
commit 190aaf5548ed28a7d91eb11e7bb79901f07df8c9
30 changes: 23 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM tiangolo/uwsgi-nginx-flask:flask

RUN apt-get update && apt-get install -y \
curl git bzr mercurial build-essential \
zip ruby-full haskell-platform shellcheck \
python-pip python-dev \
nodejs build-essential
RUN apt-get update && apt-get upgrade --fix-missing -y
RUN apt-get update && apt-get install -y curl git bzr mercurial build-essential
RUN apt-get install -y zip ruby-full haskell-platform shellcheck
RUN apt-get install -y python-pip python-dev
RUN apt-get install -y nodejs build-essential golang

ENV NVM_DIR /usr/local/nvm
ENV NODE_VERSION node
Expand All @@ -27,8 +27,24 @@ RUN echo NODE_PATH=$NVM_DIR/versions/node/v$NODE_VERSION/lib/node_modules >> /et
RUN echo PATH=$NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH >> /etc/environment

RUN pip install -U pip

RUN curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
RUN export PATH="/root/.pyenv/bin:$PATH"
ENV PATH /root/.pyenv/bin:$PATH
RUN eval "$(pyenv init -)"
RUN eval "$(pyenv virtualenv-init -)"
RUN pyenv update
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You probably want the pyenv steps lower down in the dockerfile than the known hosts steps, since they're more likely to change. E.g. when you want to switch to a new python version.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably. the pyenv stuff isn't even working yet anyway, it still seems to be using the system python.

RUN pyenv install 2.7.13
RUN pyenv install 3.6.0
COPY ./app /app
COPY requirements.txt /app

RUN pip install -r /app/requirements.txt

# Install rvm (https://github.com/vallard/docker/blob/master/rails/Dockerfile)
RUN apt-get install -y curl patch gawk g++ gcc make libc6-dev patch libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev
RUN useradd -ms /bin/bash app
USER app
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
RUN /bin/bash -l -c "curl -L get.rvm.io | bash -s stable --rails"
RUN /bin/bash -l -c "rvm install 2.1"
RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc"