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
|
||||
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
|
||||
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
|
||||
CMD python /app/bot.py
|
||||
|
@ -1,7 +1,10 @@
|
||||
FROM python as builder
|
||||
RUN apt-get update && apt-get install -y gcc make automake
|
||||
# RUN apk update && apk add --no-cache make python3-dev automake gcc libxml2-dev libxslt-dev g++
|
||||
FROM python:3.8 as build
|
||||
RUN apt-get update && apt-get install -y gcc python-pip
|
||||
|
||||
ADD app/requirements.txt /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
|
||||
|
Loading…
x
Reference in New Issue
Block a user