fix-docker #1
2
Crontab
2
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
|
0 * * * * bun run ./src/app.ts > /dev/null 2>&1
|
||||||
@@ -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
|
||||||
Reference in New Issue
Block a user