Skip to content

Add Dockerfile for the API REST server #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8-slim

COPY --chown=1000 . /code

USER 1000

ENV PYTHONUNBUFFERED 1
ENV PYTHONPATH /code

WORKDIR /code
ENV WORKON_HOME /tmp


RUN python3 -m venv .venv && \
.venv/bin/pip install -U pip && \
.venv/bin/pip install -r requirements.txt --no-cache-dir

ENV PATH=".venv/bin:$PATH"

EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]