I started to learn flask and in parallel I want to start picking Docker, in all manuals (flask / django) I recommend venv for scanning. If there is a Docker, then why the need to use too much ?? /
- oneIn this case, the excess is the docker. - Sergey Gornostaev
|
1 answer
Virualenv - obviously superfluous. After all, everything is already written in the Dockerfile .
FROM python:3.6.3-alpine3.6 COPY requirements.txt / RUN apk --update add --virtual .base build-base && \ apk add --no-cache postgresql-dev && \ pip install -r requirements.txt && \ rm requirements.txt && \ apk del .base && \ adduser -D -S -u 1000 -G users -h /home/app app && \ rm -rf /tmp/* /var/tmp/* /usr/share/man /tmp/* /var/tmp/* \ /var/cache/apk/* /var/log/* ~/.cache COPY . /home/app/ RUN chmod +x /home/app/app.py && \ chown -R app:users /home/app USER app WORKDIR /home/app CMD python -m flask run --host=0.0.0.0 --with-threads |