Skip to content

Commit

Permalink
ditch volume
Browse files Browse the repository at this point in the history
  • Loading branch information
csokun committed Jun 17, 2024
1 parent af96edf commit c22e342
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 30 deletions.
17 changes: 6 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,16 @@ COPY requirements_docker.txt requirements_versions.txt /tmp/
RUN --mount=type=cache,target=/root/.cache \
pip install --no-cache-dir -r /tmp/requirements_docker.txt -r /tmp/requirements_versions.txt && \
rm -f /tmp/requirements_docker.txt /tmp/requirements_versions.txt

RUN --mount=type=cache,target=/root/.cache \
pip install --no-cache-dir xformers==0.0.23 --no-dependencies

RUN curl -fsL -o /usr/local/lib/python3.10/dist-packages/gradio/frpc_linux_amd64_v0.2 https://cdn-media.huggingface.co/frpc-gradio-0.2/frpc_linux_amd64 && \
chmod +x /usr/local/lib/python3.10/dist-packages/gradio/frpc_linux_amd64_v0.2

RUN adduser --disabled-password --gecos '' user && \
mkdir -p /content/app /content/data

COPY entrypoint.sh /content/
RUN chown -R user:user /content

WORKDIR /content
USER user
WORKDIR /app
COPY entrypoint.sh /app

COPY . /content/app
# RUN mv /content/app/models /content/app/models.org
COPY . /app

CMD [ "sh", "-c", "/content/entrypoint.sh ${CMDARGS}" ]
CMD [ "sh", "-c", "python launch.py ${CMDARGS}" ]
35 changes: 16 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
volumes:
fooocus-data:

services:
app:
build: .
Expand All @@ -10,25 +7,25 @@ services:
- "7865:7865"
environment:
- CMDARGS=--listen # Arguments for launch.py.
- DATADIR=/content/data # Directory which stores models, outputs dir
- config_path=/content/data/config.txt
- config_example_path=/content/data/config_modification_tutorial.txt
- path_checkpoints=/content/data/models/checkpoints/
- path_loras=/content/data/models/loras/
- path_embeddings=/content/data/models/embeddings/
- path_vae_approx=/content/data/models/vae_approx/
- path_upscale_models=/content/data/models/upscale_models/
- path_inpaint=/content/data/models/inpaint/
- path_controlnet=/content/data/models/controlnet/
- path_clip_vision=/content/data/models/clip_vision/
- path_fooocus_expansion=/content/data/models/prompt_expansion/fooocus_expansion/
- path_outputs=/content/app/outputs/ # Warning: If it is not located under '/content/app', you can't see history log!
- DATADIR=/app/data # Directory which stores models, outputs dir
- config_path=/app/data/config.txt
- config_example_path=/app/data/config_modification_tutorial.txt
- path_checkpoints=/app/models/checkpoints/
- path_loras=/app/models/loras/
- path_embeddings=/app/models/embeddings/
- path_vae_approx=/app/models/vae_approx/
- path_upscale_models=/app/models/upscale_models/
- path_inpaint=/app/models/inpaint/
- path_controlnet=/app/models/controlnet/
- path_clip_vision=/app/models/clip_vision/
- path_fooocus_expansion=/app/models/prompt_expansion/fooocus_expansion/
- path_outputs=/app/outputs/ # Warning: If it is not located under '/app', you can't see history log!
- default_advanced_checkbox=True
- default_save_metadata_to_images=True
volumes:
- fooocus-data:/content/data
#- ./models:/import/models # Once you import files, you don't need to mount again.
#- ./outputs:/import/outputs # Once you import files, you don't need to mount again.
- ./data:/app/data
- ./models:/app/models # Once you import files, you don't need to mount again.
- ./outputs:/app/outputs
tty: true
deploy:
resources:
Expand Down

0 comments on commit c22e342

Please sign in to comment.