<jupyter_start><jupyter_text>Docker > The simplest way to deploy a Vespa app.  Deploy application package created with pyvespa This section assumes you have an [ApplicationPackage](../../reference-api.rstvespa.package.ApplicationPackage) instance assigned to `app_package` containing your app desired configuration. If that is not the case, you can learn how to do it by checking [some examples](../../howto/create_app_package/create_app_package.rst). For the purpose of this demonstration we are going to use a minimal (and useless) application package:<jupyter_code>from vespa.package import ApplicationPackage

app_package = ApplicationPackage(name="sample_app")<jupyter_output><empty_output><jupyter_text>We can locally deploy our `app_package` using Docker without leaving the notebook, by creating an instance of [VespaDocker](../../reference-api.rstvespa.deployment.VespaDocker), as shown below:<jupyter_code>import os
from vespa.deployment import VespaDocker

disk_folder = os.path.join(os.getenv("WORK_DIR"), "sample_application") # specify your desired absolute path here
vespa_docker = VespaDocker(
    port=8080,
    disk_folder=disk_folder
)

app = vespa_docker.deploy(
    application_package = app_package,
)<jupyter_output>Waiting for configuration server.
Waiting for configuration server.
Waiting for configuration server.
Waiting for configuration server.
Waiting for configuration server.
Waiting for application status.
Waiting for application status.
Finished deployment.<jupyter_text>`app` now holds a [Vespa](../../reference-api.rstvespa.application.Vespa) instance, which we are going to use to interact with our application. Congratulations, you now have a Vespa application up and running.  Learn Vespa by looking at underlying config files It is important to know that `pyvespa` simply provides a convenient API to define Vespa application packages from python. `vespa_docker.deploy` export Vespa configuration files to the `disk_folder` defined above. Going through those files is a nice way to start learning about Vespa syntax. It is also possible to export the Vespa configuration files representing an application package created with `pyvespa` without deploying the application by using the `export_application_package` method:<jupyter_code>vespa_docker.export_application_package(
    application_package=app_package, 
)<jupyter_output><empty_output><jupyter_text>This will export the application files to an `application` folder within the `disk_folder`.  Deploy application package from Vespa config files `pyvespa` provides a subset of the Vespa API, so there will be cases where we want to modify Vespa config files to implement Vespa features that are not yet available in `pyvespa`. We can then modify the files and continue to use pyvespa to deploy and interact with the Vespa application. To do that we can use the `deploy_from_disk` method:<jupyter_code>app = vespa_docker.deploy_from_disk(
    application_name="sample_app", 
    application_folder="application"
)
# this is a hidden cell. It will not show on the documentation HTML.
from shutil import rmtree

rmtree(disk_folder, ignore_errors=True)
vespa_docker.container.stop()
vespa_docker.container.remove()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.06518381217176399, 'fraction_numerical': 0.001235712079085573, 'mean_word_length': 5.9336188436830835, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '502095', 'license': 'Apache-2.0', 'n_tokens_mistral': 894, 'n_tokens_neox': 848, 'n_words': 350, 'path': 'docs/sphinx/source/howto/deploy_app_package/deploy-docker.ipynb', 'repo_name': 'vespa-engine/pyvespa', 'size': '3237'}