diff --git a/Dockerfile b/Dockerfile index cb90383..9bbf944 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ RUN apt update \ && apt install -y \ wget \ unzip \ + cron \ build-essential \ libssl-dev \ zlib1g-dev \ @@ -35,6 +36,6 @@ RUN chmod a+x /lufi/docker-entrypoint.sh RUN carton install --deployment --without=test --without=mysql \ && rm -rf local/cache/* local/man/* -ENTRYPOINT ["/lufi/docker-entrypoint.sh"] -EXPOSE 8081 \ No newline at end of file +EXPOSE 8081 +ENTRYPOINT ["/lufi/docker-entrypoint.sh"] \ No newline at end of file diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index e40f76f..1919b64 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,7 +1,25 @@ #!/bin/bash -# Lauch server -carton exec hypnotoad /lufi/script/lufi + +# Vérification du nombre d'arguments +if [ "$#" -eq 0 ]; then + command="start" +else + command=$1 +fi + + +# Condition pour exécuter différentes commandes en fonction du paramètre +if [ "$command" = "start" ]; then + echo "Exécution de la commande 1" + carton exec hypnotoad /lufi/script/lufi +elif [ "$command" = "cron" ]; then + echo "Exécution des cron" + # Ajoutez ici la commande que vous souhaitez exécuter pour "commande2" +else + echo "Commande non reconnue: $command" + exit 1 +fi # print logs tail -f /lufi/log/production.log \ No newline at end of file