Skip to content

Commit

Permalink
Merge "Adjust container for prod"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul CI authored and Gerrit Code Review committed Feb 7, 2025
2 parents 16bedfe + 10dd34f commit cc22319
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 8 deletions.
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ WORKDIR /opt/dci-control-server
COPY requirements.txt setup.py /opt/dci-control-server/

RUN microdnf update && \
microdnf -y install python3-pip python3-wheel && \
microdnf -y install python3-devel gcc postgresql-devel && \
pip3 --no-cache-dir install -r requirements.txt && \
microdnf -y remove python3-devel gcc postgresql-devel && \
microdnf -y clean all
microdnf -y install python3-pip python3-wheel && \
microdnf -y install python3-devel gcc postgresql-devel && \
pip3 --no-cache-dir install -r requirements.txt && \
microdnf -y remove python3-devel gcc postgresql-devel && \
microdnf -y clean all

# install source after
COPY entrypoint.sh /usr/local/sbin/
COPY entrypoint-devenv.sh entrypoint.sh /usr/local/sbin/
COPY gunicorn.conf.py /etc/

COPY . /opt/dci-control-server/
Expand Down
2 changes: 1 addition & 1 deletion dci/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@


# Logging related parameters
LOG_LEVEL = "INFO"
LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
LOG_FORMAT = "[%(asctime)s] %(levelname)-8s %(name)-12s %(message)s"


Expand Down
17 changes: 17 additions & 0 deletions entrypoint-devenv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

if ! python3 bin/dci-wait-for-db; then
echo "Unable to wait for the DB. Exiting." 1>&2
exit 0
fi

if ! python3 bin/dci-dbinit; then
echo "Unable to init the DB. Exiting." 1>&2
exit 0
fi

pubkey=$(python3 bin/dci-get-pem-ks-key.py ${SSO_URL} ${SSO_REALM})

export SSO_PUBLIC_KEY="$pubkey"
echo $SSO_PUBLIC_KEY
exec "$@"
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if ! python3 bin/dci-wait-for-db; then
exit 0
fi

if ! python3 bin/dci-dbinit; then
if ! python3 bin/dci-dbsync then
echo "Unable to init the DB. Exiting." 1>&2
exit 0
fi
Expand Down
1 change: 1 addition & 0 deletions gunicorn.conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

default_nb_workers = multiprocessing.cpu_count() * 2 + 1
workers = int(os.getenv("DCI_NB_WORKERS", default_nb_workers))
accesslog = "-"

0 comments on commit cc22319

Please sign in to comment.