Dockerfile 및 cron 파일 수정: 타임존 설정 추가 및 cron 로그 출력 경로 수정
This commit is contained in:
parent
d8c7abb531
commit
8399ce4107
2 changed files with 11 additions and 8 deletions
17
Dockerfile
17
Dockerfile
|
|
@ -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
2
cron
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue