-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
executable file
·35 lines (26 loc) · 960 Bytes
/
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
FROM python:3.9
ENV PYTHONUNBUFFERED 1
ENV PATH="${PATH}:/root/.poetry/bin"
ENV WORKDIR="/app"
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --fix-missing \
apt-utils \
apt-transport-https \
build-essential
#Install Poetry
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
# Nicer Bash Setup
RUN sed -i "s/# export LS_OPTIONS/export LS_OPTIONS/" /root/.bashrc
RUN sed -i "s/# alias ll/alias ll/" /root/.bashrc
RUN sed -i "s/# alias ls/alias ls/" /root/.bashrc
RUN sed -i "s/# alias l/alias l/" /root/.bashrc
# App
RUN mkdir -p ${WORKDIR}
WORKDIR ${WORKDIR}
# Install poetry packages before copying entire directory to take advantage of docker layer caching
COPY ./poetry.lock ${WORKDIR}/poetry.lock
COPY ./pyproject.toml ${WORKDIR}/pyproject.toml
RUN poetry config virtualenvs.create false
RUN poetry install --no-interaction
COPY . ${WORKDIR}
CMD /bin/bash