Skip to content
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

Single requirements file #184

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ RUN apt update && apt install -y \
&& rm -rf /var/lib/apt/lists/*

# install python libraries (except torch)
COPY requirements/ requirements/
COPY requirements.txt .
ENV PIP_CERT=$CACERT_LOCATION
RUN pip --default-timeout=300 install --upgrade pip \
&& pip --default-timeout=300 install --no-cache-dir -r requirements/common.txt \
&& pip --default-timeout=300 install --no-cache-dir -r requirements.txt \
&& rm -r /root/.cache

ARG VERSION
Expand All @@ -31,14 +31,14 @@ RUN mkdir -p src/weights \

# launch website
FROM base as dev
RUN pip --default-timeout=300 install --no-cache-dir -r requirements/dev.txt
CMD ["uvicorn", "src.main:app", "--reload", "--host", "0.0.0.0", "--port", "5000"]

FROM base as test
RUN pip install -r requirements/dev.txt && pip install requests && rm -r /root/.cache
RUN pip install requests && rm -r /root/.cache
COPY tests/ tests/
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "5000"]

FROM base as prod
RUN pip install --no-cache-dir -r requirements/prod.txt
RUN pip install --extra-index-url https://download.pytorch.org/whl/cpu \
torch==1.13.0+cpu torchvision==0.14.0+cpu && rm -r /root/.cache
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "5000"]
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
--extra-index-url https://download.pytorch.org/whl/cpu
fastapi==0.68.0
uvicorn==0.14.0
python-multipart>=0.0.5
Expand All @@ -6,4 +7,6 @@ pyyaml>=5.4.1
user-agents==2.2.0
ua-parser==0.10.0
python-openstackclient==5.8.0
python-swiftclient==4.0.0
python-swiftclient==4.0.0
torch==1.13.0
torchvision==0.14.0
3 changes: 0 additions & 3 deletions backend/requirements/dev.txt

This file was deleted.

3 changes: 0 additions & 3 deletions backend/requirements/prod.txt

This file was deleted.