66# When bumping Python versions, we currently have to update the `.python-version` file and this `ARG`
77ARG 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
1212ENV PATH=/venv/bin:$PATH
@@ -18,7 +18,7 @@ COPY requirements-prod-ingestion.txt requirements-prod-ingestion.txt
1818# Main build process
1919RUN 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
4141WORKDIR /code
@@ -55,7 +55,7 @@ EXPOSE 8000
5555# Reinstall system libraries required for PostgreSQL drivers
5656RUN 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