Skip to content

Commit 865a234

Browse files
author
Joshua Mayanja
committed
Changed Docker File
1 parent 264d4e5 commit 865a234

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ env/
22
spam-classifier/
33
zips/
44
ignored/
5+
models/
56
*.pkl
67

Dockerfile

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
FROM python:3.7-slim
22

3-
COPY ./app ./app/app
4-
COPY ./requirements.txt ./app/requirements.txt
3+
COPY ./app /app/app
4+
COPY ./.env /app/.env
5+
COPY ./models /app/models
6+
COPY ./entry_point.sh /app/entry_point.sh
7+
COPY ./requirements.txt /app/requirements.txt
58

69
WORKDIR /app
710

@@ -23,4 +26,6 @@ RUN apt-get autoremove -y \
2326

2427
RUN virtualenv -p python3 ./env
2528

26-
RUN ./env/bin/python3 -m pip install -r requirements.txt
29+
RUN ./env/bin/python3 -m pip install -r requirements.txt
30+
31+
CMD [ "entry_point.sh" ]

entry_point.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
RUN_PORT=${PORT:-8989}
4+
5+
/app/.env/bin/gunicorn --worker-tmp-dir /dev/shm -k uvicorn.workers.UvicornWorker --bind "0.0.0.0:${RUN_PORT}"

0 commit comments

Comments
 (0)