Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

Optimize backend docker image #37

Closed
ddanielgal opened this issue Jul 16, 2019 · 2 comments
Closed

Optimize backend docker image #37

ddanielgal opened this issue Jul 16, 2019 · 2 comments
Assignees
Labels
backend Django REST API

Comments

@ddanielgal
Copy link
Collaborator

Remove graphviz and other unnecessary dependencies.

@ddanielgal
Copy link
Collaborator Author

psycopg/psycopg2#684

@ddanielgal
Copy link
Collaborator Author

I use this in another project. This produces a 400MB image instead of 800MB.

FROM python:3.6-alpine

ENV CONFIG_FILE=/code/config.yaml

RUN mkdir /code
ADD . /code
WORKDIR /code

RUN apk add --no-cache --virtual .build-deps gcc build-base python3-dev py-pip jpeg-dev zlib-dev musl-dev postgresql-dev && \
    pip install pipenv && \
    pipenv lock && \
    pipenv install --system --dev && \
    apk del --no-cache .build-deps && \
    apk add libpq

ENTRYPOINT ["sh", "docker-entrypoint.sh"]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend Django REST API
Projects
None yet
Development

No branches or pull requests

2 participants