fix-docker #1

Merged
chiko merged 12 commits from fix-docker into main 2025-10-21 00:52:32 +00:00
2 changed files with 6 additions and 4 deletions
Showing only changes of commit 877d9e37b3 - Show all commits

View File

@@ -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 0 * * * * bun run ./src/app.ts > /dev/null 2>&1

View File

@@ -28,22 +28,24 @@ RUN cd /temp/prod && bun install --frozen-lockfile --production
# then copy all (non-ignored) project files into the image # then copy all (non-ignored) project files into the image
FROM base AS prerelease FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules COPY --from=install /temp/dev/node_modules node_modules
COPY . . COPY . ./
# [optional] tests & build # [optional] tests & build
ENV NODE_ENV=production ENV NODE_ENV=production
# copy production dependencies and source code into final image # copy production dependencies and source code into final image
FROM base AS release FROM base AS release
WORKDIR /opt/app
COPY --from=install /temp/prod/node_modules node_modules COPY --from=install /temp/prod/node_modules node_modules
COPY --from=prerelease /opt/app/src/app.ts . COPY --from=prerelease /opt/app/src/app.ts .
COPY --from=prerelease /opt/app/package.json . COPY --from=prerelease /opt/app/package.json .
COPY --from=prerelease /opt/app/entrypoint.sh . #COPY --from=prerelease .entrypoint.sh .
COPY Crontab /etc/cron.d/ COPY Crontab /etc/cron.d/
RUN chmod 0644 /etc/cron.d/Crontab RUN chmod 0644 /etc/cron.d/Crontab
COPY . ./
# USER bun # USER bun
RUN touch /var/log/cron.log RUN touch /var/log/cron.log
# RUN chmod +x entrypoint.sh # RUN chmod +x entrypoint.sh
# ENTRYPOINT ["./entrypoint.sh"] # ENTRYPOINT ["./entrypoint.sh"]
VOLUME ["/opt/app/data/db"] VOLUME ["/opt/app/data/db"]
CMD cron && tail -f /var/log/cron.log CMD bun run ./src/app.ts --today && cron && tail -f /var/log/cron.log