I am using this dockerfile configuration for my django project
FROM python:3.12.2-slim-bullseye
Install system dependencies
RUN apt-get update && apt-get install -y
python3-pip
python3-cffi
python3-brotli
libpango1.0-0
libpangoft2-1.0-0
libharfbuzz-subset0
libffi-dev
libcairo2
libcairo2-dev
libjpeg62-turbo-dev
libgdk-pixbuf2.0-0
libgdk-pixbuf2.0-dev
libgobject-2.0-0
libgobject2.0-dev
build-essential
&& apt-get clean
ENV LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
Set the working directory
WORKDIR /PAQSBackend
Copy the application code
COPY . /PAQSBackend/
RUN pip install -r requirements.txt
COPY PAQSBackend.wsgi /PAQSBackend/PAQSBackend.wsgi
CMD [“gunicorn”, “–bind”, “0.0.0.0:8000”, “PAQSBackend.wsgi”]
The build and deployment runs fine. However, when I run the project, I get this error message
File “/opt/venv/lib/python3.11/site-packages/cffi/api.py”, line 827, in loadbackend_lib
raise OSError(msg)
OSError: cannot load library ‘gobject-2.0-0’: gobject-2.0-0: cannot open shared object file: No such file or directory. Additionally, ctypes.util.find_library() did not manage to locate a library called ‘gobject-2.0-0’
I would want to know what is actually happening and also how to resolve this. I only face this issue when I am deploying it on Railway.app