diff --git a/.gitignore b/.gitignore index 6320cd2..0405824 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -data \ No newline at end of file +data +tasks \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 1d7d413..0e1df29 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,10 @@ version: "3" services: - cronicle: - image: soulteary/cronicle:0.9.63 + build: + context: ./docker + dockerfile: Dockerfile restart: always hostname: cronicle ports: @@ -14,16 +15,17 @@ services: - ./data/data:/opt/cronicle/data - ./data/logs:/opt/cronicle/logs - ./data/plugins:/opt/cronicle/plugins + - ./tasks:/opt/cronicle/tasks extra_hosts: - "cronicle.lab.io:0.0.0.0" environment: - - TZ=Asia/Shanghai + - TZ=Europe/Rome healthcheck: test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider localhost:3012/api/app/ping || exit 1"] interval: 5s timeout: 1s retries: 3 logging: - driver: "json-file" - options: - max-size: "10m" + driver: "json-file" + options: + max-size: "10m" \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index 5872f77..5c1094b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,25 +1,36 @@ -FROM node:18-bullseye AS Builder -ENV CRONICLE_VERSION=0.9.63 -WORKDIR /opt/cronicle -RUN curl -L -o /tmp/Cronicle-${CRONICLE_VERSION}.tar.gz https://github.com/jhuckaby/Cronicle/archive/refs/tags/v${CRONICLE_VERSION}.tar.gz -# COPY Cronicle-${CRONICLE_VERSION}.tar.gz /tmp/ -RUN tar zxvf /tmp/Cronicle-${CRONICLE_VERSION}.tar.gz -C /tmp/ && \ - mv /tmp/Cronicle-${CRONICLE_VERSION}/* . && \ - rm -rf /tmp/* && \ - yarn -COPY ./patches /tmp/patches -RUN patch -p3 < /tmp/patches/engine.patch lib/engine.js -COPY docker-entrypoint.js ./bin/ +FROM soulteary/cronicle:0.9.63 +# Installa le dipendenze necessarie +RUN apk add --no-cache \ + icu-libs \ + krb5-libs \ + libgcc \ + libintl \ + libssl3 \ + libstdc++ \ + zlib \ + wget \ + bash \ + ca-certificates \ + gcompat -FROM node:18-alpine -RUN apk add procps curl -COPY --from=builder /opt/cronicle/ /opt/cronicle/ -WORKDIR /opt/cronicle -ENV CRONICLE_foreground=1 -ENV CRONICLE_echo=1 -ENV CRONICLE_color=1 -ENV debug_level=1 -ENV HOSTNAME=main -RUN node bin/build.js dist && bin/control.sh setup -CMD ["node", "bin/docker-entrypoint.js"] \ No newline at end of file +# Installa .NET usando lo script ufficiale +RUN wget https://dot.net/v1/dotnet-install.sh && \ + chmod +x dotnet-install.sh && \ + ./dotnet-install.sh --channel 8.0 --runtime aspnetcore --install-dir /usr/share/dotnet && \ + ln -sf /usr/share/dotnet/dotnet /usr/local/bin/dotnet && \ + rm dotnet-install.sh + +# Imposta le variabili d'ambiente per .NET +ENV \ + DOTNET_ROOT=/usr/share/dotnet \ + PATH="$PATH:/usr/share/dotnet" \ + DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=false \ + ASPNETCORE_URLS=http://+:5000 + +# Rendi eseguibile dotnet e imposta i permessi +RUN chmod +x /usr/share/dotnet/dotnet && \ + chmod +x /usr/local/bin/dotnet + +# Verifica l'installazione di .NET +RUN dotnet --info || true \ No newline at end of file