<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="134611" data-post-id="134611">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>At this point I’d say you should publish that new app in GitHub so other people can check.</p>
<p>Also include exact Erlang and Elixir versions (putting this in a <code>.tool-versions</code> file in the repo is what I do).</p>
<p>I’ve ran a lot of Phoenix apps and very rarely did any of them surpass 50-60MB of RAM.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="134611" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/running-elixir-with-limited-heap-size/23633/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-134611" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="134611"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="134693" data-post-id="134693">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="ollran" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  ollran
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>YES, IT FINALLY WORKS!</p>
<p>I am on MacOS and I cannot install Elixir on the server. So, I am using Docker for cross compiling the project for Debian 8.</p>
<p>So basically I run these commands:</p>
<pre><code>$ docker build .
[...]
Successfully built 65d60d773205
$ docker create 65d60d773205
$ docker cp dca434f3938c415ebb419d3214b5cc3092e2c7ecdeacf03e52ca4e44eac6bde2:webapp.txz .
$ scp webapp.txz me@myserver.com:
$ ssh me@myserver.com
$ tar xvf webapp.txz
$ _build/prod/rel/webapp/bin/webapp start
</code></pre>
<p>I only needed <code>+MMscs 60</code> (thank you <a class="mention" href="/u/alvises" rel="nofollow">@alvises</a>). I commented out the rest.</p>
<p>This is my Dockerfile:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">FROM debian:8

WORKDIR /app

RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get update &amp;&amp; \
    apt-get -y upgrade &amp;&amp; \
    apt-get -y dist-upgrade &amp;&amp; \
    apt-get install -y --no-install-recommends apt-utils &amp;&amp; \
    apt-get -y install wget libwxbase3.0-0 libwxgtk3.0-0 libsctp1 xz-utils

RUN wget -O - https://deb.nodesource.com/setup_12.x | bash - &amp;&amp; \
    apt-get install -y nodejs

RUN wget https://packages.erlang-solutions.com/erlang/debian/pool/esl-erlang_22.0.4-1~debian~jessie_amd64.deb &amp;&amp; \
    wget https://packages.erlang-solutions.com/erlang/debian/pool/elixir_1.9.0-1~debian~jessie_all.deb

RUN dpkg -i esl-erlang_22.0.4-1~debian~jessie_amd64.deb &amp;&amp; \
    dpkg -i elixir_1.9.0-1~debian~jessie_all.deb

RUN mix local.hex --force &amp;&amp; \
    mix local.rebar --force &amp;&amp; \
    yes | mix archive.install hex phx_new 1.4.8

RUN mix phx.new webapp --no-ecto

RUN cd webapp &amp;&amp; \
    mix deps.get &amp;&amp; \
    mix compile

RUN echo "config :webapp, WebappWeb.Endpoint, server: true" &gt;&gt; webapp/config/prod.exs

RUN cd webapp/assets &amp;&amp; \
    npm install &amp;&amp; \
    npm audit fix

RUN cd webapp/assets &amp;&amp; \
    npx webpack --mode production &amp;&amp; \
    cd .. &amp;&amp; \
    mix phx.digest

RUN cd webapp &amp;&amp; \
    SECRET_KEY_BASE=$(mix phx.gen.secret) MIX_ENV=prod mix release

# The magic happens in here
RUN cd webapp/_build/prod/rel/webapp/releases/0.1.0/ &amp;&amp; \
    #echo "+MMsco true" &gt;&gt; vm.args &amp;&amp; \
    #echo "+Musac false" &gt;&gt; vm.args &amp;&amp; \
    echo "+MMscs 60" &gt;&gt; vm.args

RUN cd webapp &amp;&amp; \
    tar cJvf webapp.txz _build &amp;&amp; \
    mv webapp.txz ../..

CMD ["webapp/_build/prod/rel/webapp/bin/webapp", "start"]
</code></pre>
<p>Thank you, everyone!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="134693" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/running-elixir-with-limited-heap-size/23633/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-134693" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="134693"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="134716" data-post-id="134716">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="NobbZ" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/NobbZ/120/27235_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  NobbZ
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Your resulting image is unnecessarily bloated.</p>
<p>You probably do <strong>not</strong> need a full <code>debian:8</code> under your feets.</p>
<p>Using the builder images by <a class="mention" href="/u/beardedeagle" rel="nofollow">@beardedeagle</a> combined with a multistage build you can get image sizes far less than 100 MB.</p>
<p>Also remember, if done correctly, neither erlang, nor elixir are a runtime requirement.</p>
<p>So in theory you could even use a base image that is compatible to your server, build a release therein, extract that release and only deploy the extracted release to your server. This will probably result in the smallest deployment size.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="134716" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/running-elixir-with-limited-heap-size/23633/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-134716" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="134716"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="134832" data-post-id="134832">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="garazdawi" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/garazdawi/120/5853_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  garazdawi
                  </h3>
		          </div>
						
			          <div class="user-title">
									<span>Erlang Core Team</span>
			          </div>
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>You may want to try <code>+Meamin</code>. This will disable all the erts memory allocators and fall back to malloc which can sometimes use less memory.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="134832" data-batch-url="/posts/batch_likers">
                        7
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/running-elixir-with-limited-heap-size/23633/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-134832" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="134832"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>