Skip to content

Commit 1fcb57b

Browse files
committed
CDD-000: specify individual libraries rather than full fat docker image
1 parent 8fd789a commit 1fcb57b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# When bumping Python versions, we currently have to update the `.python-version` file and this `ARG`
77
ARG PYTHON_VERSION=3.12.13
88

9-
FROM python:${PYTHON_VERSION} AS build
9+
FROM python:${PYTHON_VERSION}-slim AS build
1010

1111
# Ensure the virtual environment will be available on the `PATH` variable
1212
ENV PATH=/venv/bin:$PATH
@@ -18,7 +18,7 @@ COPY requirements-prod-ingestion.txt requirements-prod-ingestion.txt
1818
# Main build process
1919
RUN apt-get update \
2020
# Update the database of available packages
21-
&& apt-get -y install libpq-dev gcc \
21+
&& apt-get -y install libpq-dev gcc libnss3-dev libexpat1-dev\
2222
# Install toolchain needed for C libraries like `psycopg2`
2323
&& python3 -m venv /venv \
2424
# Create the python virtual environment
@@ -35,7 +35,7 @@ COPY . code
3535
###############################################################################
3636
# Production stage
3737
###############################################################################
38-
FROM python:${PYTHON_VERSION} AS production
38+
FROM python:${PYTHON_VERSION}-slim AS production
3939

4040
# Sets the working directory for subsequent `RUN`, `ENTRYPOINT` & `CMD` layers
4141
WORKDIR /code
@@ -55,7 +55,7 @@ EXPOSE 8000
5555
# Reinstall system libraries required for PostgreSQL drivers
5656
RUN apt-get update \
5757
# Update the database of available packages
58-
&& apt-get -y install libpq-dev \
58+
&& apt-get -y install libpq-dev libnss3-dev libexpat1-dev\
5959
# Reinstall the C library needed for `psycopg2`
6060
&& chmod +x entrypoint.sh
6161
# Add execution permission for the entrypoint shell script

0 commit comments

Comments
 (0)