title: Python write permission denied in docker container
body: <p>I'm trying to use pandas to write a csv to file in my flask app (wrapped with <code>uwsgi</code>) but I keep getting a <code>permission denied</code> error, despite adding uwsgi to my <code>user-group</code>, have I missed something?</p>
  <h2>docker buildfile:</h2>
  <pre><code>FROM kennethreitz/pipenv as build
  ADD . /app
  WORKDIR /app
  RUN pipenv install --deploy --system \
   &amp;&amp; pipenv lock -r &gt; requirements.txt \
   &amp;&amp; pipenv run python setup.py bdist_wheel
  
  FROM ubuntu:bionic
  COPY --from=build /app/dist/*.whl .
  ARG DEBIAN_FRONTEND=noninteractive
  RUN set -xe \
   &amp;&amp; apt-get update -q \
   &amp;&amp; apt-get install -y -q \
          python3-wheel \
          python3-pip \
          uwsgi-plugin-python3 \
   &amp;&amp; python3 -m pip install *.whl \
   &amp;&amp; apt-get remove -y python3-pip python3-wheel \
   &amp;&amp; apt-get autoremove -y \
   &amp;&amp; apt-get clean -y \
   &amp;&amp; rm -f *.whl \
   &amp;&amp; rm -rf /var/lib/apt/lists/* \
   &amp;&amp; mkdir -p /app \
   &amp;&amp; useradd _uwsgi --no-create-home --user-group
  USER _uwsgi
  ENTRYPOINT [&quot;/usr/bin/uwsgi&quot;, \
              &quot;--master&quot;, \
              &quot;--enable-threads&quot;, \
              &quot;--die-on-term&quot;, \
              &quot;--plugin&quot;, &quot;python3&quot;]
  CMD [&quot;--http-socket&quot;, &quot;0.0.0.0:8000&quot;, \
       &quot;--processes&quot;, &quot;4&quot;, \
       &quot;--chdir&quot;, &quot;/app&quot;, \
       &quot;--check-static&quot;, &quot;static&quot;, \
       &quot;--module&quot;, &quot;server:app&quot;]
  </code></pre>