This repository has been archived by the owner on Mar 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
63 lines (45 loc) · 1.42 KB
/
Dockerfile
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
FROM alpine:3.12
RUN apk add curl \
ca-certificates \
bash \
git \
openssl-dev \
libffi-dev \
zlib-dev \
readline-dev \
bzip2-dev \
sqlite-dev \
linux-headers \
make \
build-base
RUN apk add --no-cache python3 py3-pip
#RUN git clone https://github.com/pyenv/pyenv.git ~/.pyenv
#RUN echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
#RUN echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
#RUN echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
#RUN echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
#RUN echo -e 'if command -v pyenv 1>/dev/null 2>&1; then eval "$(pyenv init -)" fi' >> ~/.bash_profile
#RUN echo -e 'if command -v pyenv 1>/dev/null 2>&1; then eval "$(pyenv init -)" fi' >> ~/.bashrc
#RUN pyenv install 3.8.3
#RUN global install 3.8.3
#RUN local install 3.8.3
# Set Python version
ARG PYTHON_VERSION='3.8.3'
# Set pyenv home
ARG PYENV_HOME=/root/.pyenv
# Install pyenv, then install python versions
RUN git clone --depth 1 https://github.com/pyenv/pyenv.git $PYENV_HOME && \
rm -rfv $PYENV_HOME/.git
ENV PATH $PYENV_HOME/shims:$PYENV_HOME/bin:$PATH
RUN pyenv install $PYTHON_VERSION
RUN pyenv global $PYTHON_VERSION
RUN pip install --upgrade pip && pyenv rehash
# Clean
RUN rm -rf ~/.cache/pip
COPY . /home/app
WORKDIR /home/app
RUN pip install pipenv
RUN pipenv install
#RUN pipenv lock --requirements > requirements.txt
CMD pipenv run python server.py
EXPOSE 8080