Skip to content

Commit

Permalink
Merge 8f48083 into ba8a2db
Browse files Browse the repository at this point in the history
  • Loading branch information
hluk committed Jun 9, 2022
2 parents ba8a2db + 8f48083 commit 1be09d3
Showing 1 changed file with 25 additions and 31 deletions.
56 changes: 25 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,55 +1,49 @@
FROM registry.centos.org/centos:8
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.5
LABEL \
name="product-listings-manager" \
vendor="product-listings-manager developers" \
license="MIT" \
build-date=""

# https://www.centos.org/centos-linux-eol/
RUN sed -i -e "s|mirrorlist=|#mirrorlist=|g" /etc/yum.repos.d/CentOS-* \
&& sed -i -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-* \
&& yum install -y epel-release \
&& yum -y install \
--setopt=install_weak_deps=false \
--setopt=tsflags=nodocs \
# hadolint ignore=DL3013
RUN microdnf -y install \
--setopt=install_weak_deps=0 \
--nodocs \
gcc \
git-core \
krb5-devel \
krb5-libs \
python3 \
python3-flask \
python3-flask-sqlalchemy \
python3-gunicorn \
python3-koji \
python3-devel \
python3-pip \
python3-psycopg2 \
python3-sqlalchemy

RUN pip3 install \
flask-restful==0.3.8
python3-sqlalchemy \
&& microdnf -y clean all \
&& pip3 install --no-cache-dir \
flask==0.12.2 \
flask-restful==0.3.8 \
flask-sqlalchemy==2.4.4 \
gunicorn==20.0.4 \
koji

WORKDIR /var/www/product-listings-manager

# Restore working tree from current git commit in container.
COPY .git .git
RUN git reset --hard HEAD \
&& git checkout HEAD

# Clean up.
RUN yum -y remove git-core \
&& yum -y clean all \
&& rm -rf /var/cache/yum \
&& rm -rf /tmp/*

ARG cacert_url
RUN if [ -n "$cacert_url" ]; then \
cd /etc/pki/ca-trust/source/anchors \
&& curl -O --insecure $cacert_url \
&& update-ca-trust extract; \
fi
&& git checkout HEAD \
# Clean up.
&& microdnf -y remove \
gcc \
git-core \
krb5-devel \
python3-devel

USER 1001
EXPOSE 5000

ENTRYPOINT [ \
"/usr/bin/gunicorn-3", \
"gunicorn", \
"--bind=0.0.0.0:5000", \
"--access-logfile=-", \
"--enable-stdio-inheritance", \
Expand Down

0 comments on commit 1be09d3

Please sign in to comment.