forked from BrianPugh/python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (27 loc) · 810 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
36
37
38
39
40
# syntax=docker/dockerfile:1.4.1
FROM ubuntu:20.04 AS build
ENV PATH "/root/.local/bin/:$PATH"
ENV POETRY_INSTALLER_MAX_WORKERS 8
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
build-essential \
ca-certificates \
ca-certificates \
curl \
git \
python3-dev \
python3-venv\
&& rm -rf /var/lib/apt/lists/*
RUN curl -sSL https://install.python-poetry.org | python3 -
COPY . /pythontemplate
WORKDIR /pythontemplate
RUN poetry install --without=dev,docs \
&& rm -rf .git
FROM ubuntu:20.04
ENV PATH ".venv/bin:$PATH"
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /pythontemplate /pythontemplate
WORKDIR /pythontemplate