psycopg2 installation for python:2.7-alpine in Docker

If you only need to install psycopg2 for python 2.7 on Docker image based on python:2.7-alpine then following code for Dockerfile will be nice for you:

FROM python:2.7-alpine

RUN apk update && \
    apk add --virtual build-deps gcc python-dev musl-dev && \
    apk add postgresql-dev

RUN pip install psycopg2

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)