From 877d9e37b3f07c0947f9ba728a6e487c5ed38e11 Mon Sep 17 00:00:00 2001 From: chiko Date: Mon, 20 Oct 2025 23:16:35 +0200 Subject: [PATCH] Udpated Dockerfile, changed Crontab for testing purposes --- Crontab | 2 +- Dockerfile | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Crontab b/Crontab index b6ea5bc..c1dd39e 100644 --- a/Crontab +++ b/Crontab @@ -1,2 +1,2 @@ -0 8 * * * bun run ./src/app.ts --today > /dev/null 2>&1 +1 * * * * bun run ./src/app.ts --today > /dev/null 2>&1 0 * * * * bun run ./src/app.ts > /dev/null 2>&1 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 775a558..4de43a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,22 +28,24 @@ RUN cd /temp/prod && bun install --frozen-lockfile --production # then copy all (non-ignored) project files into the image FROM base AS prerelease COPY --from=install /temp/dev/node_modules node_modules -COPY . . +COPY . ./ # [optional] tests & build ENV NODE_ENV=production # copy production dependencies and source code into final image FROM base AS release +WORKDIR /opt/app COPY --from=install /temp/prod/node_modules node_modules COPY --from=prerelease /opt/app/src/app.ts . COPY --from=prerelease /opt/app/package.json . -COPY --from=prerelease /opt/app/entrypoint.sh . +#COPY --from=prerelease .entrypoint.sh . COPY Crontab /etc/cron.d/ RUN chmod 0644 /etc/cron.d/Crontab +COPY . ./ # USER bun RUN touch /var/log/cron.log # RUN chmod +x entrypoint.sh # ENTRYPOINT ["./entrypoint.sh"] VOLUME ["/opt/app/data/db"] -CMD cron && tail -f /var/log/cron.log \ No newline at end of file +CMD bun run ./src/app.ts --today && cron && tail -f /var/log/cron.log \ No newline at end of file