-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile-dev
38 lines (29 loc) · 1.27 KB
/
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
FROM python:3.8-slim-buster as build
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
RUN apt-get update && apt-get autoremove && \
apt-get autoclean && apt-get install -y \
python3-pip python3-setuptools python3-wheel \
python3.8-dev python3.8 libpq-dev build-essential postgresql-client tree
RUN mkdir /code
WORKDIR /code
ADD requirements /code/requirements
RUN pip3 install --no-binary psycopg2 six gunicorn -r requirements/dev.txt
######################################################################
FROM python:3.8-slim-buster
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH /code/src
RUN mkdir /code
WORKDIR /code
COPY . /code
COPY --from=build /usr/local/bin/ /usr/local/bin/
COPY --from=build /usr/local/lib/python3.8/dist-packages/ /usr/local/lib/python3.8/dist-packages/
COPY --from=build /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/
COPY --from=build /usr/lib/python3/dist-packages/ /usr/lib/python3/dist-packages/
RUN apt-get update && apt-get autoremove && apt-get autoclean && \
apt-get install -y postgresql-client graphviz tree
RUN pip3 freeze
RUN echo "sys.path: " && python3 -c "import sys; print(sys.path)"
RUN echo "Python: " && python --version
RUN echo "Python 3: " && python3 --version