diff --git a/Dockerfile b/Dockerfile index cdb69e1420..88be576f47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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}" ] diff --git a/docker-compose.yml b/docker-compose.yml index ed127b37c2..8fc5f8cfcb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,3 @@ -volumes: - fooocus-data: - services: app: build: . @@ -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: