-
Notifications
You must be signed in to change notification settings - Fork 61
/
Dockerfile.dev
41 lines (29 loc) · 1018 Bytes
/
Dockerfile.dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
FROM docker.io/klakegg/hugo:0.68.3-ext
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE 1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED 1
# Installs build dependecies
RUN apt update && apt install -y curl zlib1g-dev libssl-dev build-essential libffi-dev
RUN useradd -ms /bin/bash appuser
USER appuser
VOLUME ["/app"]
WORKDIR /app
# Installs Pyenv
ENV PATH="/home/appuser/.pyenv/bin:/home/appuser/.local/bin:${PATH}"
RUN curl https://pyenv.run | bash
RUN export PATH="$(pyenv root)/shims/python:$PATH"
RUN echo 'eval "$(pyenv init --path)"' >> ~/.bashrc
# Installs Python
ADD [".python-version", "/app/"]
RUN pyenv install
# Sets default Python version
RUN pyenv global $(cat .python-version)
#Installs Pipenv
RUN pyenv exec pip install pipenv --user
# Installs dependencies
ADD ["Pipfile*", "/app/"]
RUN export PIPENV_PYTHON="$(pyenv root)/shims/python"
RUN pipenv sync --dev
ENTRYPOINT [ "/bin/bash", "-c" ]
CMD [ "pipenv run bash run.sh" ]