Skip to content

Commit

Permalink
Slight changes for dockerised version
Browse files Browse the repository at this point in the history
  • Loading branch information
john-hawkins committed Sep 6, 2024
1 parent 3d720e7 commit 1b1adb0
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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 pip install -r requirements.txt

# Stage 2
FROM python:3-alpine AS runner

WORKDIR /app

COPY --from=builder /app/venv venv
COPY minvime minvime
COPY minvime-runner.py app.py

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"]
1 change: 1 addition & 0 deletions minvime-runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""Convenience wrapper for running minvime directly from source tree."""

from minvime.minvime import main
from minvime.minvime import app

if __name__ == '__main__':
main()
Expand Down
3 changes: 2 additions & 1 deletion minvime/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
These methods need to make some very strong assumptions about the way your model will be deployed and used.
Please read through the notes on each method and feel free to contribute ideas to the development of this tool.
</td>
@john_c_hawkins
<td>
<a href='https://x.com/john_c_hawkins'>@john_c_hawkins</a>
</td>
</tr>
</table>
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
gunicorn
setuptools
Flask>=2.2.2
numpy>=1.16.4
pandas>=0.25.3
Expand Down

0 comments on commit 1b1adb0

Please sign in to comment.