jhj0517 commited on
Commit
4f3aeaa
1 Parent(s): a567563

Add docker files

Browse files
Files changed (2) hide show
  1. docker/Dockerfile +36 -0
  2. docker/docker-compose.yaml +29 -0
docker/Dockerfile ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM debian:bookworm-slim AS builder
2
+
3
+ RUN apt-get update && \
4
+ apt-get install -y curl git python3 python3-pip python3-venv && \
5
+ rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* && \
6
+ mkdir -p /AdvancedLivePortrait-WebUI
7
+
8
+ WORKDIR /AdvancedLivePortrait-WebUI
9
+
10
+ # Edit to `requirements-cpu.txt` if you're not using Nvidia GPU
11
+ COPY requirements.txt .
12
+
13
+ # Edit to `requirements-cpu.txt` if you're not using Nvidia GPU
14
+ RUN python3 -m venv venv && \
15
+ . venv/bin/activate && \
16
+ pip install --no-cache-dir -r requirements.txt
17
+
18
+
19
+ FROM debian:bookworm-slim AS runtime
20
+
21
+ RUN apt-get update && \
22
+ apt-get install -y curl ffmpeg python3 && \
23
+ rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
24
+
25
+ WORKDIR /AdvancedLivePortrait-WebUI
26
+
27
+ COPY . .
28
+ COPY --from=builder /AdvancedLivePortrait-WebUI/venv /AdvancedLivePortrait-WebUI/venv
29
+
30
+ VOLUME [ "/AdvancedLivePortrait-WebUI/models" ]
31
+ VOLUME [ "/AdvancedLivePortrait-WebUI/outputs" ]
32
+
33
+ ENV PATH="/AdvancedLivePortrait-WebUI/venv/bin:$PATH"
34
+ ENV LD_LIBRARY_PATH=/AdvancedLivePortrait-WebUI/venv/lib64/python3.11/site-packages/nvidia/cublas/lib:AdvancedLivePortrait-WebUI/venv/lib64/python3.11/site-packages/nvidia/cudnn/lib
35
+
36
+ ENTRYPOINT [ "python", "app.py" ]
docker/docker-compose.yaml ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ app:
3
+ build: .
4
+ image: jhj0517/advancedliveportrait-webui:latest
5
+
6
+ volumes:
7
+ # Update paths to mount models and output paths to your custom paths like this, e.g:
8
+ # - C:/AdvancedLivePortrait-WebUI/custom-model-path:/AdvancedLivePortrait-WebUI/models
9
+ # - C:/AdvancedLivePortrait-WebUI/custom-output-path:/AdvancedLivePortrait-WebUI/outputs
10
+ - /AdvancedLivePortrait-WebUI/models
11
+ - /AdvancedLivePortrait-WebUI/outputs
12
+
13
+ ports:
14
+ - "7860:7860"
15
+
16
+ stdin_open: true
17
+ tty: true
18
+
19
+ entrypoint: ["python", "app.py", "--server_port", "7860", "--server_name", "0.0.0.0",]
20
+
21
+ # If you're not using nvidia GPU, Update device to match yours.
22
+ # See more info at : https://docs.docker.com/compose/compose-file/deploy/#driver
23
+ deploy:
24
+ resources:
25
+ reservations:
26
+ devices:
27
+ - driver: nvidia
28
+ count: all
29
+ capabilities: [ gpu ]