Dockerfile 및 cron 파일 수정: 타임존 설정 추가 및 cron 로그 출력 경로 수정

This commit is contained in:
imnyang 2025-05-09 20:16:59 +09:00
commit 8399ce4107
2 changed files with 11 additions and 8 deletions

View file

@ -1,6 +1,12 @@
FROM oven/bun:alpine
LABEL maintainer="@imnya"
# Set timezone to Asia/Seoul
RUN apk add --no-cache tzdata \
&& cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime \
&& echo "Asia/Seoul" > /etc/timezone \
&& apk del tzdata
# Set the working directory
COPY app /code/app
COPY .env /code/app/.env
@ -13,13 +19,10 @@ RUN mkdir -p /code/app/temp
# Install dependencies
RUN bun install
# Run Cron job
RUN apk add dcron
RUN rc-update add dcron
RUN touch /var/log/cron.log
RUN service dcron start
# Cron job
RUN apk add --no-cache dcron bash
# Copy the cron job file
COPY cron /etc/cron.d/cronjob
COPY cron /etc/crontabs/root
CMD [ "sleep", "infinity" ]
CMD ["crond", "-f"]

2
cron
View file

@ -1 +1 @@
0 22 * * * /code/app/run.sh
0 22 * * * /code/app/run.sh >> /code/app/temp/run-$(date +%Y%m%d-%H%M%S).log 2>&1