# Custom Dockerfile

**URL:** <https://discuss.huggingface.co/t/custom-dockerfile/27154>\
**Category:** Spaces\
**Created:** [December 2, 2022, 9:12pm UTC](https://discuss.huggingface.co/t/custom-dockerfile/27154 "2022-12-02T21:12:17Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ugaray96](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ugaray96/32/12082_2.png) [@ugaray96](https://discuss.huggingface.co/u/ugaray96)\
**Post date:** [December 2, 2022, 9:12pm UTC](https://discuss.huggingface.co/t/custom-dockerfile/27154/1 "2022-12-02T21:12:17Z")

</div>

How can I add a custom Dockerfile and let know Huggingface Spaces that I want to use that Dockerfile instead of the one it uses as default?

My repository is [this one](https://github.com/ugm2/neural-search-demo/tree/feature/custom_docker), where you will find the Dockerfile and the Readme where the configuration of the SDK is (I tried removing this thinking that Spaces would then start using my Dockerfile, but it doesn’t, it gives a config error)

Any help is welcome! Thank you in advance!

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [December 3, 2022, 12:37am UTC](https://discuss.huggingface.co/t/custom-dockerfile/27154/2 "2022-12-03T00:37:45Z")

</div>

hi @ugaray96 we’re currently working to support Dockerfile 🙌 it will come soon!  
I see you have you’re demo already running here [Neural Search Demo - a Hugging Face Space by ugaray96](https://huggingface.co/spaces/ugaray96/neural-search) is there anything on our base streamlit sdk that doesn’t work for you?

---

<div class="post-metadata">

**Author:** ![ugaray96](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ugaray96/32/12082_2.png) [@ugaray96](https://discuss.huggingface.co/u/ugaray96)\
**Post date:** [December 3, 2022, 12:51am UTC](https://discuss.huggingface.co/t/custom-dockerfile/27154/3 "2022-12-03T00:51:23Z")

</div>

Hi @radames ! Thanks for answering so quickly!  
My demo is perfectly running. All this comes because I want to be able to launch Elasticsearch inside the virtual machine (to enable certain search features)  
I’ve been trying to do so programatically in Python but is kind of hard.  
So I was wondering if I could just spin up an Elasticsearch instance using Docker

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [December 3, 2022, 1:03am UTC](https://discuss.huggingface.co/t/custom-dockerfile/27154/4 "2022-12-03T01:03:23Z")

</div>

Hi @ugaray96 I see, in that case a Dockerfile would be much easier. I’ll DM you here.

---

<div class="post-metadata">

**Author:** ![hugbump](https://avatars.discourse-cdn.com/v4/letter/h/3da27b/32.png) [@hugbump](https://discuss.huggingface.co/u/hugbump)\
**Post date:** [December 11, 2022, 7:47am UTC](https://discuss.huggingface.co/t/custom-dockerfile/27154/5 "2022-12-11T07:47:40Z")

</div>

Looking forward to the Dockerfile support!

---

<div class="post-metadata">

**Author:** ![hugbump](https://avatars.discourse-cdn.com/v4/letter/h/3da27b/32.png) [@hugbump](https://discuss.huggingface.co/u/hugbump)\
**Post date:** [December 11, 2022, 7:49pm UTC](https://discuss.huggingface.co/t/custom-dockerfile/27154/6 "2022-12-11T19:49:06Z")

</div>

Hi @radames this space of yours [radames/stable-diffusion-depth2img at main](https://huggingface.co/spaces/radames/stable-diffusion-depth2img/tree/main) has a custom Dockerfile. Does this mean it is supported now? Let me know if I missed something. Thank you!

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [December 18, 2022, 3:18am UTC](https://discuss.huggingface.co/t/custom-dockerfile/27154/7 "2022-12-18T03:18:03Z")

</div>

Hello @hugbump and @ugaray96 Spaces Docker now it’s official!

> <https://twitter.com/victormustar/status/1603782210070253568>

> **[Docker Spaces](https://huggingface.co/docs/hub/spaces-sdks-docker)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

---

<div class="post-metadata">

**Author:** ![ugaray96](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ugaray96/32/12082_2.png) [@ugaray96](https://discuss.huggingface.co/u/ugaray96)\
**Post date:** [December 19, 2022, 1:00pm UTC](https://discuss.huggingface.co/t/custom-dockerfile/27154/8 "2022-12-19T13:00:19Z")

</div>

Hi @radames those are awesome news!!!  
I’m trying now to get it working with Elasticsearch. Do you know if we can use docker-compose.yml?  
Thanks!

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [December 19, 2022, 2:43pm UTC](https://discuss.huggingface.co/t/custom-dockerfile/27154/9 "2022-12-19T14:43:18Z")

</div>

Hi @ugaray96 , we don’t have plans to support docker compose at the moment. But depending on your application, you can manually create multi Spaces.

---

<div class="post-metadata">

**Author:** ![ugaray96](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ugaray96/32/12082_2.png) [@ugaray96](https://discuss.huggingface.co/u/ugaray96)\
**Post date:** [December 19, 2022, 4:12pm UTC](https://discuss.huggingface.co/t/custom-dockerfile/27154/10 "2022-12-19T16:12:31Z")

</div>

I’m trying to deploy an application that uses Elasticsearch internally for search, as a backend.  
I don’t know what multi Spaces are. Would it be deploying Elasticsearch in one Space and using it from another?

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](https://discuss.huggingface.co/u/radames)\
**Post date:** [December 19, 2022, 4:28pm UTC](https://discuss.huggingface.co/t/custom-dockerfile/27154/11 "2022-12-19T16:28:50Z")

</div>

> [@ugaray96](#):
>
> Would it be deploying Elasticsearch in one Space and using it from another?

exactly! Please let me know if that works

---

<div class="post-metadata">

**Author:** ![hugbump](https://avatars.discourse-cdn.com/v4/letter/h/3da27b/32.png) [@hugbump](https://discuss.huggingface.co/u/hugbump)\
**Post date:** [December 19, 2022, 5:29pm UTC](https://discuss.huggingface.co/t/custom-dockerfile/27154/12 "2022-12-19T17:29:40Z")

</div>

This is cool! Thank you @radames!

---

<div class="post-metadata">

**Author:** ![ugaray96](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ugaray96/32/12082_2.png) [@ugaray96](https://discuss.huggingface.co/u/ugaray96)\
**Post date:** [December 20, 2022, 11:04am UTC](https://discuss.huggingface.co/t/custom-dockerfile/27154/13 "2022-12-20T11:04:38Z")

</div>

And how do I reference the other Space’s Elasticsearch url? Is it public by default or do the Spaces communicate in a smart way?
