add app dir
This commit is contained in:
parent
013d2e8ac7
commit
c7583fa3ca
3 changed files with 10 additions and 11 deletions
15
Dockerfile
15
Dockerfile
|
@ -1,19 +1,18 @@
|
|||
FROM python:3.12-bookworm
|
||||
|
||||
FROM python:3.12-bookworm-slim
|
||||
WORKDIR /app
|
||||
LABEL MAINTAINER="Jan-Ole Hübner <huebner@jan-ole.de>"
|
||||
|
||||
RUN apt-get update && apt-get install -y cron
|
||||
|
||||
ADD requirements.txt /
|
||||
ADD requirements.txt /app
|
||||
RUN pip3 install -r /requirements.txt
|
||||
|
||||
ENV PYTHONIOENCODING=utf-8
|
||||
|
||||
ADD . /
|
||||
ADD . /app
|
||||
|
||||
RUN printenv > /env
|
||||
|
||||
RUN echo "*/2 * * * * /delay_price.sh >> /var/log/cron.log 2>&1" > /etc/cron.d/get_price
|
||||
RUN echo "*/2 * * * * /app/delay_price.sh >> /var/log/cron.log 2>&1" > /etc/cron.d/get_price
|
||||
|
||||
RUN chmod 0644 /etc/cron.d/get_price
|
||||
|
||||
|
@ -21,6 +20,6 @@ RUN crontab /etc/cron.d/get_price
|
|||
|
||||
RUN touch /var/log/cron.log
|
||||
|
||||
RUN chmod 755 /pulse.py /get_price.py /start.sh /delay_price.sh
|
||||
RUN chmod 755 /app/pulse.py /app/get_price.py /app/start.sh /app/delay_price.sh
|
||||
|
||||
CMD ["./start.sh"]
|
||||
CMD ["/app/start.sh"]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#!/bin/bash
|
||||
source /env
|
||||
source /app/env
|
||||
sleep 2
|
||||
|
||||
python3 /get_price.py >> /var/log/cron.log 2>&1
|
||||
python3 /app/get_price.py >> /var/log/cron.log 2>&1
|
2
start.sh
2
start.sh
|
@ -1,5 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
printenv > /app/env
|
||||
# Start the cron service
|
||||
service cron start
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue