Last active
January 31, 2023 17:54
-
-
Save kwilczynski/c608b9d177bd1b5be71a619d4544431e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM registry.access.redhat.com/ubi8/python-39:latest AS builder | |
ARG psycopg2_version=2.9.5 | |
USER 0 | |
RUN set -eux && \ | |
mkdir -p /build && \ | |
chown 1001 /build | |
WORKDIR /build | |
RUN set -eux && \ | |
dnf upgrade -y && \ | |
dnf install -y libpq-devel && \ | |
dnf install -y python3-devel | |
USER 1001 | |
RUN set -eux && \ | |
git clone https://github.com/psycopg/psycopg2 . && \ | |
git switch -c ${psycopg2_version//\./_} | |
RUN set -eux && \ | |
python setup.py bdist_egg && \ | |
mv -f ./dist/*.egg . | |
FROM registry.access.redhat.com/ubi8/python-39:latest | |
COPY --from=builder /build/psycopg2-*.egg ./ | |
USER 0 | |
ENV PIP_DISABLE_PIP_VERSION_CHECK 1 | |
RUN set -eux && \ | |
python3 -m easy_install psycopg2-*.egg && \ | |
rm -f psycopg2-*.egg && \ | |
pip3 list | |
WORKDIR /dashdotdb | |
COPY . ./ | |
ENV PIP_NO_CACHE_DIR 1 | |
RUN set -eux && \ | |
pip3 install gunicorn && \ | |
pip3 install . && \ | |
pip3 list | |
USER 1001 | |
ENTRYPOINT ["./entrypoint.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment