이건 Python이 잘못했다다
This commit is contained in:
parent
2d2e546673
commit
ca946990e1
41 changed files with 3081 additions and 964 deletions
42
Dockerfile
42
Dockerfile
|
|
@ -1,29 +1,25 @@
|
|||
FROM python:3.12
|
||||
FROM oven/bun:alpine
|
||||
LABEL maintainer="@imnya"
|
||||
|
||||
# Setup System
|
||||
RUN sed -i 's@deb.debian.org@ftp.kaist.ac.kr@g' /etc/apt/sources.list.d/debian.sources
|
||||
RUN pip install --upgrade pip
|
||||
RUN apt update -y && apt upgrade -y && apt install -y cron
|
||||
|
||||
COPY config.json /code/app/config.json
|
||||
|
||||
# Setup Crontab
|
||||
WORKDIR /code
|
||||
COPY crontab /code/crontab
|
||||
COPY requirements.txt /code/requirements.txt
|
||||
# Set the working directory
|
||||
COPY app /code/app
|
||||
COPY .env /code/app/.env
|
||||
|
||||
COPY crontab /etc/cron.d/crontab
|
||||
RUN chmod 0644 /etc/cron.d/crontab
|
||||
RUN echo "" >> /etc/cron.d/crontab # Ensure newline at end of file
|
||||
RUN /usr/bin/crontab /etc/cron.d/crontab
|
||||
RUN chmod +x /code/app/run.sh
|
||||
|
||||
# Setup Python Environment
|
||||
WORKDIR /code
|
||||
RUN pip config set global.break-system-packages true
|
||||
RUN pip install -r requirements.txt
|
||||
WORKDIR /code/app
|
||||
RUN mkdir -p /code/app/temp
|
||||
|
||||
RUN rm -rf /etc/localtime
|
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
|
||||
# Install dependencies
|
||||
RUN bun install
|
||||
|
||||
CMD ["cron", "-f"]
|
||||
# Run Cron job
|
||||
RUN apk add dcron
|
||||
RUN rc-update add dcron
|
||||
RUN touch /var/log/cron.log
|
||||
RUN service dcron start
|
||||
|
||||
# Copy the cron job file
|
||||
COPY cron /etc/cron.d/cronjob
|
||||
|
||||
CMD [ "sleep", "infinity" ]
|
||||
Loading…
Add table
Add a link
Reference in a new issue