Spaces:
Running
Running
switch to uv
Browse files- Dockerfile +7 -10
- conda.yaml +0 -5
Dockerfile
CHANGED
@@ -1,22 +1,19 @@
|
|
1 |
-
FROM
|
2 |
|
3 |
-
COPY . /home/mambauser/bootstrap
|
4 |
-
RUN --mount=type=cache,uid=57439,gid=57439,target=/opt/conda/pkgs micromamba env create --yes --file /home/mambauser/bootstrap/conda.yaml \
|
5 |
-
&& micromamba install -n base --yes curl
|
6 |
USER root
|
7 |
# for some reason huggingface run container images as uid=1000
|
8 |
RUN useradd -m -u 1000 runtime-user \
|
9 |
-
&& apt-get update && apt-get install --yes libgl1 libglib2.0-0 libgl1-mesa-glx
|
10 |
WORKDIR /app
|
11 |
RUN chown -Rc runtime-user /app
|
12 |
USER runtime-user
|
13 |
RUN mkdir -pv /app/storage \
|
14 |
-
&&
|
15 |
|
16 |
-
|
17 |
-
#
|
18 |
-
|
19 |
-
RUN venv
|
20 |
# NOTE for unknown reason we need to download here. or there will be runtime file permission error
|
21 |
RUN venv/bin/python docker_prepare.py --models ocr.48px,ocr.48px_ctc,ocr.32px,ocr.mocr,detector.default,detector.ctd,detector.craft,detector.none
|
22 |
CMD venv/bin/python gradio-main.py
|
|
|
1 |
+
FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim
|
2 |
|
|
|
|
|
|
|
3 |
USER root
|
4 |
# for some reason huggingface run container images as uid=1000
|
5 |
RUN useradd -m -u 1000 runtime-user \
|
6 |
+
&& apt-get update && apt-get install --yes curl libgl1 libglib2.0-0 libgl1-mesa-glx
|
7 |
WORKDIR /app
|
8 |
RUN chown -Rc runtime-user /app
|
9 |
USER runtime-user
|
10 |
RUN mkdir -pv /app/storage \
|
11 |
+
&& uv venv --clear --python=3.11 /app/venv
|
12 |
|
13 |
+
RUN curl -L https://github.com/moeflow-com/manga-image-translator/archive/7513db7e8d4a9986e1b186f5fbd2146e39e392d0.tar.gz | tar xvz --strip-components=1
|
14 |
+
# not caching pip: HF space does not seem to have layer cache anyway
|
15 |
+
# the extra "setuptools" is necessary to run
|
16 |
+
RUN UV_PYTHON=venv uv pip install --no-cache -r requirements-moeflow.txt setuptools
|
17 |
# NOTE for unknown reason we need to download here. or there will be runtime file permission error
|
18 |
RUN venv/bin/python docker_prepare.py --models ocr.48px,ocr.48px_ctc,ocr.32px,ocr.mocr,detector.default,detector.ctd,detector.craft,detector.none
|
19 |
CMD venv/bin/python gradio-main.py
|
conda.yaml
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
name: mit-py311
|
2 |
-
channels:
|
3 |
-
- conda-forge
|
4 |
-
dependencies:
|
5 |
-
- python<3.12
|
|
|
|
|
|
|
|
|
|
|
|