<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Glot blog]]></title><description><![CDATA[Glot blog]]></description><link>https://blog.glot.io</link><generator>RSS for Node</generator><lastBuildDate>Mon, 13 Apr 2026 22:16:18 GMT</lastBuildDate><atom:link href="https://blog.glot.io/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Create a code sandbox with docker-run]]></title><description><![CDATA[How to create a simple web page that let's you run python code (or any other language) from the browser:

These instructions are for ubuntu 20.10, but should be similar for other linux distros.
Install docker-run
Docker-run will be used to run the co...]]></description><link>https://blog.glot.io/create-a-code-sandbox-with-docker-run</link><guid isPermaLink="true">https://blog.glot.io/create-a-code-sandbox-with-docker-run</guid><category><![CDATA[Python]]></category><category><![CDATA[Docker]]></category><dc:creator><![CDATA[Petter Rasmussen]]></dc:creator><pubDate>Fri, 01 Jan 2021 15:23:51 GMT</pubDate><content:encoded><![CDATA[<p>How to create a simple web page that let's you run python code (or any other language) from the browser:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1609513903553/mZuY4WZLF.png" alt="image.png" /></p>
<p>These instructions are for ubuntu 20.10, but should be similar for other linux distros.</p>
<h4 id="install-docker-run">Install docker-run</h4>
<p><a target="_blank" href="https://github.com/glotcode/docker-run">Docker-run</a> will be used to run the code.
Follow the <a target="_blank" href="https://github.com/glotcode/docker-run/blob/main/docs/install/ubuntu-20.10.md">instructions to install docker-run</a>.
Make sure you pull the python image:</p>
<pre><code><span class="hljs-selector-tag">docker</span> <span class="hljs-selector-tag">pull</span> <span class="hljs-selector-tag">glot</span>/<span class="hljs-selector-tag">python</span><span class="hljs-selector-pseudo">:latest</span>
</code></pre><h4 id="install-nginx">Install nginx</h4>
<p>Nginx will be used to host the web page</p>
<pre><code class="lang-bash">apt install nginx
</code></pre>
<h4 id="add-a-new-site-to-nginx">Add a new site to nginx</h4>
<pre><code class="lang-bash">curl https://gist.githubusercontent.com/prasmussen/5b1e2a42b295316dd8b1f665fa8589a7/raw/23811a690a7ce446e43c55f37d331403ec91994a/code-sandbox.conf &gt; /etc/nginx/sites-enabled/code-sandbox
</code></pre>
<h4 id="restart-nginx-to-enable-the-new-site">Restart nginx to enable the new site</h4>
<pre><code class="lang-bash">systemctl restart nginx.service
</code></pre>
<h4 id="add-the-web-page">Add the web page</h4>
<pre><code class="lang-bash">mkdir /home/glot/www
curl https://gist.githubusercontent.com/prasmussen/5b1e2a42b295316dd8b1f665fa8589a7/raw/23811a690a7ce446e43c55f37d331403ec91994a/index.html &gt; /home/glot/www/index.html
</code></pre>
<p>Edit <code>/home/glot/www/index.html</code> and change token in the <code>X-Access-Token</code> header to the token you configured when installing docker-run.</p>
<p>Your code sandbox should now be available at <code>http://&lt;your ip&gt;:8000</code>.</p>
<p>Please read the <a target="_blank" href="https://github.com/glotcode/docker-run#security">security section</a> before making your web page available on the internet. Good luck!</p>
]]></content:encoded></item><item><title><![CDATA[A new code runner api: docker-run]]></title><description><![CDATA[Docker-run provides a http api for running code inside transient docker containers. The communication with the docker daemon happens via it's api over a unix socket and is meant to run on the same machine as the docker daemon.
This could be used as a...]]></description><link>https://blog.glot.io/a-new-code-runner-api-docker-run</link><guid isPermaLink="true">https://blog.glot.io/a-new-code-runner-api-docker-run</guid><category><![CDATA[Rust]]></category><category><![CDATA[Docker]]></category><dc:creator><![CDATA[Petter Rasmussen]]></dc:creator><pubDate>Fri, 01 Jan 2021 14:49:24 GMT</pubDate><content:encoded><![CDATA[<p><a target="_blank" href="https://github.com/glotcode/docker-run">Docker-run</a> provides a http api for running code inside transient docker containers. The communication with the docker daemon happens via it's api over a unix socket and is meant to run on the same machine as the docker daemon.</p>
<p>This could be used as a drop-in replacement for the old <a target="_blank" href="https://github.com/prasmussen/glot-run">glot-run</a> if used together with the new <a target="_blank" href="https://github.com/glotcode/glot-run">glot-run 2</a>.</p>
<p>It is written in Rust and should be a lot easier to set up and configure than glot-run. It also has a lot better error handling and reporting.</p>
<p>Docker-run has been used in production on <a target="_blank" href="https://glot.io">glot.io</a> since November.</p>
]]></content:encoded></item></channel></rss>