Skip to content

Instantly share code, notes, and snippets.

@HermannBjorgvin
Last active February 5, 2021 16:46
Show Gist options
  • Save HermannBjorgvin/326d1ebf604defb801193c57de750ce6 to your computer and use it in GitHub Desktop.
Save HermannBjorgvin/326d1ebf604defb801193c57de750ce6 to your computer and use it in GitHub Desktop.
Docker pipenv+pyenv configuration
FROM ubuntu:18.04
# set environmental variables
ENV PYENV_ROOT="/root/.pyenv" \
PATH="/root/.pyenv/shims:/root/.pyenv/bin:${PATH}" \
PIPENV_YES=1 \
PIPENV_DONT_LOAD_ENV=1 \
LC_ALL="C.UTF-8" \
LANG="en_US.UTF-8"
# install pyenv
RUN apt-get update && \
apt-get install -y git mercurial build-essential libssl-dev libbz2-dev zlib1g-dev libffi-dev libreadline-dev libsqlite3-dev curl && \
curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
# install python 3.7.0 system wide
RUN pyenv install 3.7.0
RUN pyenv global 3.7.0
RUN pyenv rehash
# install pipenv
RUN pip install pipenv
COPY . /app
WORKDIR /app
RUN pipenv install --deploy --ignore-pipfile
EXPOSE 8000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment