Skip to content

Web services provided by the U.S. Geological Survey for computing seismic design parameters.

License

Notifications You must be signed in to change notification settings

cswilson-usgs/earthquake-design-ws

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

earthquake-design-ws

Web service provided by the U.S. Geological Survey for computing seismic design parameters compatible with various building code reference documents.

Build Status Coverage

Using the Generated Project

Getting Started

Before developing locally, you will need to execute the following steps to setup your local environment:

  1. Run npm install to install application development dependencies
    • The application will prompt you for configuration information, and create a file named src/conf/config.json in the project.

      The application expects that the configured postgres database already exists. If you set "database name" to anything other than "postgres" you will need to manually create the database after installing the postgres instance

  2. Setup a postgis enabled Postgres database
    • Use the mdillon/postgis image to install a docker container running Postgres:
      docker run
        --name postgres-postgis \
        -p {DB_PORT}:5432 \
        -e POSTGRES_PASSWORD={DB_PASSWORD} \
        -d mdillon/postgis
      
  3. Run data loading process for component data end points:
    • node src/lib/db/load_data.js
  4. Run npm run dev from the install directory

Docker

Building an image

  • From root of project, run:
    docker build -t usgs/earthquake-design-ws:latest .
    

Running a container

When initially creating a container from the base image, you must provide several configuration parameters based on your working environment.

  • Required configuration

    • MOUNT_PATH: The base URL path on which to listen for requests. This can be any path, or an empty path to listen on slash "/".
    • PORT: The port number on which to listen for connections. This can be any available port on the host system.
  • Start the container using the image tag.

    In the command below, replace values in brackets {VALUE} with the corresponding configuration value determined above.

    docker run -d
      --name earthquake-design-ws \
      -p {PORT}:8000 \
      -e MOUNT_PATH={MOUNT_PATH} \
      -e LEGACY_URL={LEGACY_URL} \
      usgs/earthquake-design-ws:latest
    

    Alternatively you may use docker-compose to start the container. Prior to starting the container you should update the relevant configuration information in the docker-compose.yml file and then run the command:

    docker-compose up -d
    
  • Connect to the running container in browser.

    In the URL below, replace values in brackets {VALUE} with the corresponding configuration value determined above.

    http://localhost:{PORT}{MOUNT_PATH}
    
  • Stopping and starting the container. Once you have successfully created and configured a container from a base image (above), you can subsequently start and stop the container with the following commands.

    docker stop earthquake-design-ws
    docker start earthquake-design-ws
    docker restart earthquake-design-ws
    

    If you created the container using the docker-compose method, you can start and stop the container with the following commands instead:

    docker-compose stop
    docker-compose start
    docker-compose restart
    

About

Web services provided by the U.S. Geological Survey for computing seismic design parameters.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 54.6%
  • HTML 43.7%
  • Groovy 1.2%
  • Java 0.2%
  • Shell 0.2%
  • Dockerfile 0.1%