# Recommended recipe for deploying a Julia app in Docker with efficient precompilation?

**URL:** https://discourse.julialang.org/t/recommended-recipe-for-deploying-a-julia-app-in-docker-with-efficient-precompilation/95591
**Category:** General Usage
**Tags:** docker
**Created:** [March 6, 2023, 5:40am UTC](https://discourse.julialang.org/t/recommended-recipe-for-deploying-a-julia-app-in-docker-with-efficient-precompilation/95591 "2023-03-06T05:40:16Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![mrufsvold](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mrufsvold/32/31600_2.png) [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)
#### Post date: [October 10, 2024, 8:38pm UTC](https://discourse.julialang.org/t/recommended-recipe-for-deploying-a-julia-app-in-docker-with-efficient-precompilation/95591/4 "2024-10-10T20:38:22Z")

</div>

I have a solution that allows you to benefit from precompilation cache even if you are building on a different machine!

> [@Creating a Docker Base Image to Accelerate Deployments](https://discourse.julialang.org/t/creating-a-docker-base-image-to-accelerate-deployments/121165):
>
> In my experience, deploying Julia to the cloud can be frustrating because it can be slow to build the container used to your app. [I](https://discourse.julialang.org/t/recommended-recipe-for-deploying-a-julia-app-in-docker-with-efficient-precompilation/95591) don’t [seem](https://discourse.julialang.org/t/julia-docker-aws-devops-workflow/109459/2) to be [the only one](https://discourse.julialang.org/t/rfc-cloud-container-infrastructure-management/112685/9). A major gripe is that AWS CodeBuild can’t do layer caching in a VPC, so strategies for rearranging your DockerFile to benefit from cache doesn’t help. I finally got a working solution for me. I build a base image with a SysImage of my dependencies and then copy my current src directory on deployment. Posting it here in case it is help…

---

_[View the full topic](https://discourse.julialang.org/t/recommended-recipe-for-deploying-a-julia-app-in-docker-with-efficient-precompilation/95591)._
