Improve the Dockerfile
* reduce number of layers * remove vim installation * add LICENSE and README to .dockerignore * don't cache with pip * add EXPOSE directive This set of changes reduces the image size by almost 100 Mb.
This commit is contained in:
parent
c279033330
commit
55f54497f2
|
@ -5,4 +5,6 @@ db.sqlite
|
||||||
.pytest_cache
|
.pytest_cache
|
||||||
.vscode
|
.vscode
|
||||||
.DS_Store
|
.DS_Store
|
||||||
config
|
config
|
||||||
|
LICENSE
|
||||||
|
README.md
|
||||||
|
|
15
Dockerfile
15
Dockerfile
|
@ -1,17 +1,14 @@
|
||||||
FROM python:3.7
|
FROM python:3.7
|
||||||
|
|
||||||
RUN apt-get update
|
|
||||||
|
|
||||||
RUN apt-get install -y vim
|
|
||||||
|
|
||||||
WORKDIR /code
|
WORKDIR /code
|
||||||
|
|
||||||
COPY ./requirements.txt ./
|
# copy everything into /code
|
||||||
RUN pip3 install -r requirements.txt
|
|
||||||
|
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# install dependencies
|
||||||
|
RUN pip3 install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
EXPOSE 7777
|
||||||
|
|
||||||
#gunicorn wsgi:app -b 0.0.0.0:7777 -w 2 --timeout 15 --log-level DEBUG
|
#gunicorn wsgi:app -b 0.0.0.0:7777 -w 2 --timeout 15 --log-level DEBUG
|
||||||
CMD ["gunicorn","wsgi:app","-b","0.0.0.0:7777","-w","2","--timeout","15"]
|
CMD ["gunicorn","wsgi:app","-b","0.0.0.0:7777","-w","2","--timeout","15"]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue