-
-
Notifications
You must be signed in to change notification settings - Fork 650
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (24 loc) · 819 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (24 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM continuumio/miniconda3:23.5.2-0 AS builder
RUN apt-get update && \
apt-get install -y --no-install-recommends \
apt-transport-https \
bash \
build-essential \
git
RUN conda install 'ffmpeg>=4.4.0' -c conda-forge
WORKDIR /usr/local/src
COPY . .
# Install PyTorch and other dependencies via pip
# This ensures compatible versions are installed together as specified in requirements.txt
RUN pip --no-cache-dir -v install .
# optimize layers
FROM debian:bullseye-slim
COPY --from=builder /opt/conda /opt/conda
ENV PATH=/opt/conda/bin:$PATH
# Create directory for model cache
RUN mkdir -p /root/.u2net
# Define volume for model persistence
# To use: docker run -v ~/.u2net:/root/.u2net ...
VOLUME ["/root/.u2net"]
WORKDIR /tmp
ENTRYPOINT ["python", "-m", "backgroundremover.cmd.cli"]