Skip to content

Commit

Permalink
Add psycopg2 to Docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
dhirving committed Oct 31, 2023
1 parent 4893d4e commit 796f95e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# - Runs a non-root user.
# - Sets up the entrypoint and port.

FROM python:3.11.1-slim-bullseye as base-image
FROM python:3.11.6-slim-bullseye as base-image

# Update system packages
COPY server/scripts/install-base-packages.sh .
Expand Down
1 change: 1 addition & 0 deletions server/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
uvicorn
psycopg2
4 changes: 2 additions & 2 deletions server/scripts/install-base-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ apt-get update
# Install security updates:
apt-get -y upgrade

# Example of installing a new package, without unnecessary packages:
#apt-get -y install --no-install-recommends git
# libpq is required for psycopg2, the Python postgres bindings
apt-get -y install --no-install-recommends libpq5

# Delete cached files we don't need anymore:
apt-get clean
Expand Down
3 changes: 2 additions & 1 deletion server/scripts/install-dependency-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ apt-get update
# is sometimes needed to build cffi (a cryptography dependency).
# Git is needed because we still have some Python dependencies pointing
# directly at Git repos
apt-get -y install --no-install-recommends build-essential libffi-dev git
# Libpq-dev is needed to build psycopg2, the postgres bindings for python
apt-get -y install --no-install-recommends build-essential libffi-dev git libpq-dev

# Delete cached files we don't need anymore:
apt-get clean
Expand Down

0 comments on commit 796f95e

Please sign in to comment.