<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Cameron Bulock on Medium]]></title>
        <description><![CDATA[Stories by Cameron Bulock on Medium]]></description>
        <link>https://medium.com/@cbulock?source=rss-737fa07a17fb------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*5GtxZnO4JPk4ZCIuOUf2ZQ.jpeg</url>
            <title>Stories by Cameron Bulock on Medium</title>
            <link>https://medium.com/@cbulock?source=rss-737fa07a17fb------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 02:33:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cbulock/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Deploying Create-React-App to Google Cloud Run using Nginx]]></title>
            <link>https://cbulock.medium.com/deploying-create-react-app-to-google-cloud-run-using-nginx-8266d328886c?source=rss-737fa07a17fb------2</link>
            <guid isPermaLink="false">https://medium.com/p/8266d328886c</guid>
            <category><![CDATA[google-cloud-run]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[create-react-app]]></category>
            <dc:creator><![CDATA[Cameron Bulock]]></dc:creator>
            <pubDate>Sat, 30 Jan 2021 17:09:23 GMT</pubDate>
            <atom:updated>2021-01-30T17:24:54.209Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*13BwTy2xdvt2zDQJmwW4kw.png" /></figure><p>Google’s <a href="https://cloud.google.com/run">Cloud Run</a> is a great way to get sites up and running quickly. It can take a git repo, build, and deploy within minutes. Later, deploying updates is seamless and automatic.</p><p>If using <a href="https://github.com/facebook/create-react-app">create-react-app</a>, to get this up and running, you simply need to get a <a href="https://docs.docker.com/engine/reference/builder/">Dockerfile</a> set up to help build a containerized version of your site.</p><p>Here is an example Dockerfile that will create a live build of your React project. This will run use a node environment to runnpm build and copy the built version of the app into the proper location, and then serve the app using <a href="https://nginx.org/en/">nginx</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9bf663564a154a0dba6e378b665abbc5/href">https://medium.com/media/9bf663564a154a0dba6e378b665abbc5/href</a></iframe><p>One piece of this that is important is that you need an nginx config file to serve the site. In this example, there is a file in the repo located in buildconfig/nginx.conf that is used.</p><p>Below are the contents of that file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/72411bf31db8670a3f34e8d9f973b085/href">https://medium.com/media/72411bf31db8670a3f34e8d9f973b085/href</a></iframe><p>Google Cloud Run allows you to set a port when deploying an instance, however, that port value isn’t guaranteed, and I’ve noticed it often isn’t followed. There will be a PORTenvironment variable passed into the build, and Google recommends always using this.</p><p>In the past, it wasn’t easy to use environment variables in nginx, but this Dockerfile is deploying nginx version 1.19. This allows you to easily create templates that can utilize environment variables. The <a href="https://hub.docker.com/_/nginx">Docker Hub docs for nginx</a> give some details on this.</p><p>In the Dockerfile, the config is copied to /etc/nginx/templates/default/conf.template and this will output the actual config to/etc/nginx/conf.d/default.confwith the port replaced with the value provided by Cloud Run</p><p>That should be all there is to it. These steps should work for any Docker deployment given that a PORT is passed in.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8266d328886c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>