reader.py
from os import listdir
from os.path import isfile, join
import time
volume = '/app'
delay = 10
while True:
files = []
files = [filename for filename in listdir(volume) if isfile(join(volume, filename))]
print(files)
time.sleep(delay)
FROM python:3.8.2-alpine
WORKDIR /tmp
COPY reader.py ./
CMD python ./reader.py
IMAGE_NAME='basic-reader-image'
CONTAINER_NAME='basic-reader'
docker build -t $IMAGE_NAME -f Dockerfile.reader .
docker run --name $CONTAINER_NAME -v $(pwd)/app:/app -t $IMAGE_NAME
sudo touch ./app/file1.txt ./app/file2.txt ./app/file3.txt
[]
['file2.txt', 'file1.txt', 'file3.txt']
ps -ouser,cmd,args -p 2999 (подтавьте пид который httpd