Skip to content

Instantly share code, notes, and snippets.

@deliro
Last active April 17, 2020 12:33
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save deliro/509b663093ff0f49c1b71e1876597ccb to your computer and use it in GitHub Desktop.
Save deliro/509b663093ff0f49c1b71e1876597ccb to your computer and use it in GitHub Desktop.
python alpine lxml image example
FROM python:3.7-alpine
EXPOSE 8000
WORKDIR /app
COPY . .
RUN apk add --update --no-cache --virtual .build-deps \
g++ \
python-dev \
libxml2 \
libxml2-dev && \
apk add libxslt-dev && \
pip install --no-cache-dir -r req.txt && \
apk del .build-deps
CMD ["gunicorn", "-c", "gunicorn_config.py", "src.app:application"]
@NMelis
Copy link

NMelis commented May 30, 2019


FROM python:3.7-alpine
EXPOSE 8000

RUN apk add --update --no-cache --virtual .build-deps \
        g++ \
        python-dev \
        libxml2 \
        libxml2-dev && \
    apk add libxslt-dev && \
    apk del .build-deps
RUN pip install --no-cache-dir -r req.txt

WORKDIR /app
COPY . .

CMD ["gunicorn", "-c", "gunicorn_config.py", "src.app:application"]

@vladdoster
Copy link


FROM python:3.7-alpine
EXPOSE 8000

RUN apk add --update --no-cache --virtual .build-deps \
        g++ \
        python-dev \
        libxml2 \
        libxml2-dev && \
    apk add libxslt-dev && \
    apk del .build-deps
RUN pip install --no-cache-dir -r req.txt

WORKDIR /app
COPY . .

CMD ["gunicorn", "-c", "gunicorn_config.py", "src.app:application"]

Dont you delete deps before the install?

@NMelis
Copy link

NMelis commented Apr 17, 2020

Okey


FROM python:3.7-alpine
EXPOSE 8000

RUN apk add --update --no-cache --virtual .build-deps \
        g++ \
        python-dev \
        libxml2 \
        libxml2-dev && \
    apk add libxslt-dev
RUN pip install --no-cache-dir -r req.txt
RUN apk del .build-deps

WORKDIR /app
COPY . .

CMD ["gunicorn", "-c", "gunicorn_config.py", "src.app:application"]

FROM python:3.7-alpine
EXPOSE 8000

RUN apk add --update --no-cache --virtual .build-deps \
        g++ \
        python-dev \
        libxml2 \
        libxml2-dev && \
    apk add libxslt-dev && \
    apk del .build-deps
RUN pip install --no-cache-dir -r req.txt

WORKDIR /app
COPY . .

CMD ["gunicorn", "-c", "gunicorn_config.py", "src.app:application"]

Dont you delete deps before the install?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment