Skip to content

Instantly share code, notes, and snippets.

@nitzanel
Last active October 29, 2017 20:54
Show Gist options
  • Select an option

  • Save nitzanel/3cdde570b65ddaee6c056e097be1f240 to your computer and use it in GitHub Desktop.

Select an option

Save nitzanel/3cdde570b65ddaee6c056e097be1f240 to your computer and use it in GitHub Desktop.
Instructions for deploying gittabags-registration app

Deploying:

  • Requierments - root/sudo privilege
  • Docker installed
  • Optional - docker-compose

Setting up and running the app

  • Getting the source files      bash git clone [email protected]:nitzanel/gittabags-registration
  • With Docker
    • Building the Docker container
      cd gittabags-registration
      sudo docker build -t gittabags_flask ./
    • Running the Docker container
      sudo docker run -p 3000:4000 -t gittabags_flask 
  • With Docker-Compose:
    cd gittabags-registration
    docker-compose up -d
  • Stopping the app:
    • Docker:
    docker stop $(docker ps -aq)
    • Docker-Compose:
    docker-compose down

Setting Reverse Proxy

If the server uses apache:

Setting Apache reverse proxy on /registration

If using http use port 80

if using https use port 443

If no <VirtualHost *80> exist:

<VirtualHost *:80>
        ProxyRequests On
        ProxyPass /registration/ http://localhost:3000/
        ProxyPassReverse /registration/ http://localhost:3000/
        ProxyPass /static/ http://localhost:3000/static/
        ProxyPassReverse /static/ http://localhost:3000/static/

</VirtualHost>

Otherwise - put it in an existing one.

<VirtualHost *:80>
        ...
        ProxyRequests On
        ProxyPass /registration/ http://localhost:3000/
        ProxyPassReverse /registration/ http://localhost:3000/
        ProxyPass /static/ http://localhost:3000/static/
        ProxyPassReverse /static/ http://localhost:3000/static/
        ...
</VirtualHost>

Then reload apache:

service apache2 reload

If the server uses Nginx:

Setting Nginx reverse proxy on /registration Add the following location to the nginx conf file:

location /registration/ {
    proxy_pass http://localhost:3000/
}
location /static/ {
    proxy_pass http://localhost:3000/static/
}

Then reload nginx:

service nginx reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment