Switching to multistage builds! Shrinks the container by an entire gigabyte
This commit is contained in:
parent
36ab44d8e9
commit
d3e79d2097
@ -1,8 +1,10 @@
|
|||||||
FROM python:3.8 as build
|
FROM python:3.8 as build
|
||||||
RUN apt-get update && apt-get install -y gcc python-pip
|
RUN apt-get update && apt-get install -y gcc python-pip
|
||||||
# RUN apk add --no-cache build-base g++ gcc libxml2-dev libxslt-dev libffi-dev openssl-dev make
|
|
||||||
ADD app/requirements.txt /requirements.txt
|
ADD app/requirements.txt /requirements.txt
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
FROM python:3.8-slim
|
||||||
|
COPY --from=0 /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/site-packages
|
||||||
ADD app /app
|
ADD app /app
|
||||||
CMD python /app/bot.py
|
CMD python /app/bot.py
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
FROM python as builder
|
FROM python:3.8 as build
|
||||||
RUN apt-get update && apt-get install -y gcc make automake
|
RUN apt-get update && apt-get install -y gcc python-pip
|
||||||
# RUN apk update && apk add --no-cache make python3-dev automake gcc libxml2-dev libxslt-dev g++
|
|
||||||
ADD app/requirements.txt /requirements.txt
|
ADD app/requirements.txt /requirements.txt
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
FROM python:3.8-slim
|
||||||
|
COPY --from=0 /usr/local/lib/python3.8/site-packages /usr/local/lib/python3.8/site-packages
|
||||||
|
ADD app /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
Loading…
x
Reference in New Issue
Block a user