Skip to content

Commit

Permalink
Ajout de la lib cron
Browse files Browse the repository at this point in the history
  • Loading branch information
syji35 committed Nov 22, 2023
1 parent fde0eea commit e7078df
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ RUN apt update \
&& apt install -y \
wget \
unzip \
cron \
build-essential \
libssl-dev \
zlib1g-dev \
Expand Down Expand Up @@ -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
EXPOSE 8081
ENTRYPOINT ["/lufi/docker-entrypoint.sh"]
22 changes: 20 additions & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e7078df

Please sign in to comment.