Skip to content
/ apollo Public

An OpenAPI-based Web Service for Seismic Localization and Magnitude Calculation

Notifications You must be signed in to change notification settings

INGV/apollo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apollo Logo

Apollo

Apollo is a Web Service developed using Laravel, specifically designed to expose seismic localization software "hyp2000" (https://github.com/INGV/hyp2000) and magnitude calculation software "PyML" (https://github.com/INGV/pyml) through APIs.

This work highlights the key features of Apollo, including its OpenAPI-based development, JSON communication, containerization, and open- source nature.

Clone project

git clone https://github.com/INGV/apollo.git

Develop

In develop mode, all files are "binded" into the container; it is useful to develop code.

Configure Laravel

Copy laravel environment file and set it:

$ cp ./.env.example ./.env

Start containers

Build docker images:

cd apollo
docker compose \
    -f docker-compose.yml \
    -f docker-compose.dev.yml \
    build \
    --build-arg ENV_UID=$( id -u ) \
    --build-arg ENV_GID=$( id -g ) \
    --no-cache \
    --pull

start Apollo's containers:

docker compose \
    -f docker-compose.yml \
    -f docker-compose.dev.yml \
    up \
    --remove-orphans \
    -d

install dependencies:

echo "----- 1 -----" && \
docker compose -f docker-compose.yml -f docker-compose.dev.yml exec -T --user=application apollo composer install && \
echo "----- 2 -----" && \
docker compose -f docker-compose.yml -f docker-compose.dev.yml exec -T --user=application apollo php artisan key:generate && \
echo "----- 3 -----" && \
docker compose -f docker-compose.yml -f docker-compose.dev.yml exec -T --user=application apollo chown -R $(id -u):$(id -g) ./storage && \
echo "----- 4 -----" && \
docker compose -f docker-compose.yml -f docker-compose.dev.yml exec -T --user=application apollo chown -R $(id -u):$(id -g) ./bootstrap/cache/ && \ 

Production

In production mode, all files are "copied" into the container (also .env) and you do not need "bind" files.
Build docker images:

cd apollo
docker compose \
    -f docker-compose.yml \
    -f docker-compose.prod.yml \
    build \
    --build-arg ENV_UID=$( id -u ) \
    --build-arg ENV_GID=$( id -g ) \
    --no-cache \
    --pull

start Apollo's containers:

docker compose \
    -f docker-compose.yml \
    -f docker-compose.prod.yml \
    up \
    --remove-orphans \
    -d

you can decide to:

  • bind/mount the .env file and/or the storage/ directory.

In this case, update docker-compose.prod.yml file.

Contribute

Thanks to your contributions!

Here is a list of users who already contributed to this repository:

Author

(c) 2023 Valentino Lauciani valentino.lauciani[at]ingv.it

Istituto Nazionale di Geofisica e Vulcanologia, Italia

About

An OpenAPI-based Web Service for Seismic Localization and Magnitude Calculation

Resources

Stars

Watchers

Forks

Packages

No packages published