Python write permission denied in docker container

I’m trying to use pandas to write a csv to file in my flask app (wrapped with uwsgi) but I keep getting a permission denied error, despite adding uwsgi to my user-group, have I missed something?

docker buildfile:

FROM kennethreitz/pipenv as build
ADD . /app
RUN pipenv install --deploy --system 
 && pipenv lock -r > requirements.txt 
 && pipenv run python bdist_wheel

FROM ubuntu:bionic
COPY --from=build /app/dist/*.whl .
ARG DEBIAN_FRONTEND=noninteractive
RUN set -xe 
 && apt-get update -q 
 && apt-get install -y -q 
 && python3 -m pip install *.whl 
 && apt-get remove -y python3-pip python3-wheel 
 && apt-get autoremove -y 
 && apt-get clean -y 
 && rm -f *.whl 
 && rm -rf /var/lib/apt/lists/* 
 && mkdir -p /app 
 && useradd _uwsgi --no-create-home --user-group
USER _uwsgi
ENTRYPOINT ["/usr/bin/uwsgi", 
            "--plugin", "python3"]
CMD ["--http-socket", "", 
     "--processes", "4", 
     "--chdir", "/app", 
     "--check-static", "static", 
     "--module", "server:app"]

Source: StackOverflow