2023-11-22 09:04:13 -08:00
|
|
|
FROM python:3.9-slim-buster
|
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
|
|
COPY requirements.txt .
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
COPY . /usr/src/app
|
|
|
|
|
|
|
|
EXPOSE 8080
|
2023-12-04 00:52:37 -08:00
|
|
|
|
|
|
|
# CAUTION: gunicorn must not spawn multiple workers, otherwise the db connection pool will not limit the number of connections correctly
|
2023-11-27 08:41:09 -08:00
|
|
|
CMD \
|
|
|
|
echo "$PGCACERT" | base64 --decode > ca.cer && echo "$PGCLIENTCERT" | base64 --decode > client.cer && echo "$PGCLIENTKEY" | base64 --decode > client-key.cer && \
|
2023-12-04 10:22:19 -08:00
|
|
|
gunicorn app:webapp --workers 1 --threads 1 --bind 0.0.0.0:8080
|