Skip to main content

Meta Crontab

meta system crontab job 

Dockerfile

FROM python:3.9-slim

ENV PYTHONUNBUFFERED=1
ENV TZ=Asia/Seoul
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN mkdir -p /apps
VOLUME ["/data/tomcat", "/data/tomcat"]
RUN mkdir -p /apps/filebeat-8.6.0-linux-x86_64
COPY ./filebeat-8.6.0-linux-x86_64 /apps/filebeat-8.6.0-linux-x86_64
RUN chmod go-w /apps/filebeat-8.6.0-linux-x86_64/filebeat.yml
RUN pip install --upgrade pip
RUN pip install psycopg2-binary
RUN pip install yt_dlp
COPY ./python-programes /apps
ENTRYPOINT ["/apps/filebeat-8.6.0-linux-x86_64/startfilebeat.sh"]

실행 Shell

#!/bin/bash

VERSION=$1

echo ">> Build Version : " $VERSION

docker build -t tomcat-meta-batch:$VERSION /data/tomcat/scm/dockerimage/meta-batch

docker tag tomcat-meta-batch:$VERSION web.joang.com:9002/tomcat-meta-batch:$VERSION
docker tag tomcat-meta-batch:$VERSION web.joang.com:9002/tomcat-meta-batch:latest

docker push web.joang.com:9002/tomcat-meta-batch:$VERSION
docker push web.joang.com:9002/tomcat-meta-batch:latest

exit 0

실행 : ./dockerbuild.sh 1

docker run -it --name=python-test tomcat-meta-batch:1 /bin/bash

들어가서 확인 ! 

실행하면 이미 실행하고 이다고 나오면 삭제  :  

docker rm 3e8aafcd3e8a77434d6e263b9459ae8e290c4b5f4b0ba58d0007ca7eff778d2e --force

그리고 다시 시작 !