-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25bd378
commit 8744e2b
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 1,33 @@ | ||
FROM python:3-alpine AS builder | ||
|
||
WORKDIR /app | ||
|
||
RUN python3 -m venv venv | ||
ENV VIRTUAL_ENV=/app/venv | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||
|
||
COPY requirements.txt . | ||
RUN apt-get update -y | ||
RUN apt install libgl1-mesa-glx -y | ||
RUN apt-get install 'ffmpeg'\ | ||
'libsm6'\ | ||
'libxext6' -y | ||
RUN pip install --upgrade pip | ||
RUN pip install opencv-python==4.3.0.38 | ||
RUN pip install -r requirements.txt | ||
|
||
# Stage 2 | ||
FROM python:3-alpine AS runner | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/venv venv | ||
COPY . /app | ||
|
||
ENV VIRTUAL_ENV=/app/venv | ||
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | ||
ENV FLASK_APP=app/app.py | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["gunicorn", "--bind" , ":8080", "--workers", "2", "app:app"] |