Git Product home page Git Product logo

walkermatt / gridref-web Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 28 KB

A super simple service to convert an alpha numeric Ordnance Survey grid reference to easting / northing or easting / northing to a grid reference

Home Page: http://gridref.longwayaround.org.uk

License: Eclipse Public License 1.0

Clojure 52.31% CSS 1.47% JavaScript 5.27% Dockerfile 0.76% Procfile 0.40% HTML 39.80%

gridref-web's Introduction

GridRef Web

A super simple service to convert an alpha numeric Ordnance Survey grid reference to easting / northing or easting / northing to a grid reference.

View online at https://gridref.longwayaround.org.uk.

Usage

To start a local web server for development you can use ring:

lein ring server-headless

Docker

Build and run a Docker image based on the Dockerfile.

docker build -t gridref-web .
docker run -it --rm --memory-swap 250m --memory 250m --env PORT=8181 -p 8181:8181 --name gridref-web gridref-web

Notes

Specifying the same value for --memory-swap and --memory effectively limits the container to that much memory without swap which mimics the fly.io free-tier.

The above sets the PORT environment variable which is used in the Dockerfile to determine which port the embedded app server listens on; the -p option exposes the container port to localhost for testing.

Fly.io

Initial setup and deployment under a fly.dev domain:

flyctl auth login
fly launch

Choices made via fly launch:

# ? Choose an app name (leave blank to generate one): gridref-web
# ? Choose a region for deployment: London, United Kingdom (lhr)
# Created app 'gridref-web' in organization 'personal'
# ? Would you like to set up a Postgresql database now? No
# ? Would you like to set up an Upstash Redis database now? No
# ? Create .dockerignore from 3 .gitignore files? Yes
# ? Would you like to deploy now? No

Check the generated fly.toml (no changes needed) so we can deploy which will make the app available under a fly.dev sub-domain.

flyctl deploy

Setup a sub-domain and cert:

  1. Create a CNAME to pointing at the fly.dev sub-domain of the app
  2. Request a certificate via the flyctl:
flyctl certs create gridref.longwayaround.org.uk

App is available at https://gridref.longwayaround.org.uk/.

gridref-web's People

Contributors

walkermatt avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.