Docker compile python file in Dockerfile don’t create pyc

I would compile my python file (.py) in Dockerfile for create pyc file and then delete all *.py.

I create a Dockerfile like tisone:

FROM python:3.6-alpine
RUN apk update
RUN apk add --no-cache make linux-headers libffi-dev jpeg-dev zlib-dev
RUN apk add postgresql-dev gcc python3-dev musl-dev

VOLUME /var/lib/cathstudio/data
WORKDIR /var/lib/cathstudio/data

COPY ./requirements.txt .

RUN pip install --upgrade pip
RUN pip install -r requirements.txt
#ENV PYTHONPATH /var/lib/cathstudio/data

COPY . /var/lib/cathstudio/data

RUN python -m compileall ajaxfuncs/

well, when i build my image compilation seems to be done:

enter image description here

but when i browse my file in volumes no pyc file are present:

enter image description here

How can i compile my python file during docker build for having the pyc s?

So many thanks in advance

Source: StackOverflow