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.
git clone https://github.com/INGV/apollo.git
In develop mode, all files are "binded" into the container; it is useful to develop code.
Copy laravel environment file and set it:
$ cp ./.env.example ./.env
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/ && \
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 thestorage/
directory.
In this case, update docker-compose.prod.yml
file.
Thanks to your contributions!
Here is a list of users who already contributed to this repository:
(c) 2023 Valentino Lauciani valentino.lauciani[at]ingv.it
Istituto Nazionale di Geofisica e Vulcanologia, Italia