<!DOCTYPE html><htmllang="ro"><head><metacharSet="utf-8"/><metahttp-equiv="X-UA-Compatible"content="IE=edge"/><title>Docker · Docusaurus</title><metaname="viewport"content="width=device-width"/><metaname="generator"content="Docusaurus"/><metaname="description"content="[Docker](https://www.docker.com/) is a tool that enables you to create, deploy, and manage lightweight, stand-alone packages that contain everything needed to run an application. It can help us to avoid conflicting dependencies & unwanted behavior when running Docusaurus."/><metaname="docsearch:version"content="1.14.6"/><metaname="docsearch:language"content="ro"/><metaproperty="og:title"content="Docker · Docusaurus"/><metaproperty="og:type"content="website"/><metaproperty="og:url"content="https://docusaurus.io/"/><metaproperty="og:description"content="[Docker](https://www.docker.com/) is a tool that enables you to create, deploy, and manage lightweight, stand-alone packages that contain everything needed to run an application. It can help us to avoid conflicting dependencies & unwanted behavior when running Docusaurus."/><metaproperty="og:image"content="https://docusaurus.io/img/docusaurus.png"/><metaname="twitter:card"content="summary"/><metaname="twitter:image"content="https://docusaurus.io/img/docusaurus.png"/><linkrel="shortcut icon"href="/img/docusaurus.ico"/><linkrel="stylesheet"href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><linkrel="stylesheet"href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/atom-one-dark.min.css"/><linkrel="alternate"type="application/atom+xml"href="https://docusaurus.io/blog/atom.xml"title="Docusaurus Blog ATOM Feed"/><linkrel="alternate"type="application/rss+xml"href="https://docusaurus.io/blog/feed.xml"title="Docusaurus Blog RSS Feed"/><script>
</script></nav></div><divclass="container mainContainer docsContainer"><divclass="wrapper"><divclass="post"><headerclass="postHeader"><aclass="edit-page-link button"href="https://crowdin.com/project/docusaurus/ro"target="_blank"rel="noreferrer noopener">Translate</a><h1id="__docusaurus"class="postHeaderTitle">Docker</h1></header><article><div><span><p><ahref="https://www.docker.com/">Docker</a> is a tool that enables you to create, deploy, and manage lightweight, stand-alone packages that contain everything needed to run an application. It can help us to avoid conflicting dependencies & unwanted behavior when running Docusaurus.</p>
<p>Ensure you have previously installed <ahref="https://www.docker.com/get-started">docker</a>.</p>
<p>To run the local web server:</p>
<ol>
<li><p><strong>Build the docker image</strong> -- Enter the folder where you have Docusaurus installed. Run <code>docker build -t docusaurus-doc .</code></p>
<p>Once the build phase finishes, you can verify the image exists by running <code>docker images</code>.</p>
<blockquote>
<p>We now include a <code>Dockerfile</code> when you install Docusaurus.</p>
</blockquote></li>
<li><p><strong>Run the Docusaurus container</strong> -- To start docker run <code>docker run --rm -p 3000:3000 docusaurus-doc</code></p>
<p>This will start a docker container with the image <code>docusaurus-doc</code>. To see more detailed container info run <code>docker ps</code> .</p></li>
<p>We can also use <code>docker-compose</code> to configure our application. This feature of docker allows you to run the web server and any additional services with a single command.</p>
<blockquote>
<p>Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.</p>
</blockquote>
<p>Using Compose is a three-step process:</p>
<ol>
<li><p>Define your app’s environment with a Dockerfile so it can be reproduced anywhere.</p></li>
<li><p>Define the services that make up your app in <code>docker-compose.yml</code> so they can be run together in an isolated environment.</p></li>
<li><p>Run <code>docker-compose up</code> and Compose starts and runs your entire app.</p></li>
</ol>
<p>We include a basic <code>docker-compose.yml</code> in your project:</p>
<p>To run a local web server with <code>docker-compose</code> run <code>docker-compose up</code>.</p>
<p>To build static HTML pages for publishing run <code>docker-compose run docusaurus bash -c 'yarn publish-gh-pages'</code></p>
</span></div></article></div><divclass="docs-prevnext"><aclass="docs-prev button"href="/docs/ro/publishing"><spanclass="arrow-prev">← </span><span>Publishing your site</span></a><aclass="docs-next button"href="/docs/ro/adding-blog"><span>Adding a Blog</span><spanclass="arrow-next"> →</span></a></div></div></div><navclass="onPageNav"><ulclass="toc-headings"><li><ahref="#run-the-local-web-server-in-docker">Run the local web server in docker</a></li><li><ahref="#use-docker-compose">Use docker-compose</a></li></ul></nav></div><footerclass="nav-footer"id="footer"><sectionclass="sitemap"><ahref="/"class="nav-home"><imgsrc="/img/docusaurus_monochrome.svg"alt="Docusaurus"width="66"height="58"/></a><divclass="footerSection"><h5>Docs</h5><ahref="