Skip to content
Snippets Groups Projects
Verified Commit f130407b authored by Carolina Fernandez's avatar Carolina Fernandez
Browse files

feature/docker-env: add Dockerfile and scripts

parent c15f13b9
No related branches found
No related tags found
1 merge request!12Docker virtual deployment
FROM python:alpine3.17
LABEL version="1.0"
LABEL maintainer="Geant LSO Team <@geant.org>"
RUN apk add --no-cache bash curl vim
# RUN pip install --pre --extra-index-url https://artifactory.software.geant.org/artifactory/api/pypi/geant-swd-pypi/simple goat-lso
WORKDIR /opt/lso
COPY . .
RUN pip install -e .
RUN pip install -r requirements.txt
# Generate documentation
RUN ./build-docs.sh
# Generate sample configuration file
RUN ln -s config.json.example config.json
# ENTRYPOINT ["sleep", "inf"]
# ENTRYPOINT ["SETTINGS_FILENAME=./config.json", "python", "-m", "lso.app"]
ENTRYPOINT ["./docker/app-run.sh"]
#!/usr/bin/env bash
SETTINGS_FILENAME=./config.json python -m lso.app
#!/usr/bin/env bash
goat_name="goat-lso"
goat_image="goat/lso"
goat_tag="1.0"
if [[ $(docker image list | grep "${goat_image}" | grep "${goat_tag}" | wc -l) -eq 0 ]]; then
docker build -f docker/Dockerfile -t ${goat_image}:${goat_tag} .
fi
if [[ $(docker ps -a | grep "${goat_image}:${goat_tag}" | wc -l) -eq 0 ]]; then
docker run -d -p 44444:44444 --name ${goat_name} ${goat_image}:${goat_tag} >/dev/null 2>&1
fi
if [[ "$( docker container inspect -f '{{.State.Status}}' ${goat_name} )" != "running" ]]; then
docker start ${goat_name} >/dev/null 2>&1
fi
sleep 1
# Check endpoints
curl -f http://localhost:44444/docs >/dev/null 2>&1
if [[ $? -eq 0 ]]; then
echo "LSO is running. OpenAPI available at http://localhost:44444/docs"
else
echo "LSO is not running"
fi
#!/usr/bin/env bash
docker stop goat-lso >/dev/null 2>&1
docker rm goat-lso >/dev/null 2>&1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment