parent
564a9ba977
commit
4eb313eb9a
@ -0,0 +1,35 @@
|
||||
FROM python
|
||||
|
||||
LABEL maintainer "TiynGER <mail@martenkante.eu>"
|
||||
|
||||
ENV USER admin
|
||||
|
||||
ENV PSWD admin
|
||||
|
||||
ENV URL admin
|
||||
|
||||
ENV HOST mysql
|
||||
|
||||
ENV INTERVAL 86400
|
||||
|
||||
ENV DB_USER root
|
||||
|
||||
ENV DB_PSWD root
|
||||
|
||||
RUN git clone https://github.com/tiyn/stud.ip-crawler /studip
|
||||
|
||||
WORKDIR /studip
|
||||
|
||||
RUN pip install -r src/requirements.txt
|
||||
|
||||
ADD run.sh .
|
||||
|
||||
RUN chmod +x run.sh
|
||||
|
||||
RUN chmod +x src/run.py
|
||||
|
||||
VOLUME /studip/src/data
|
||||
|
||||
WORKDIR /studip/src
|
||||
|
||||
CMD ["/studip/run.sh"]
|
@ -0,0 +1,29 @@
|
||||
version: "3.1"
|
||||
services:
|
||||
studip:
|
||||
image: tiyn/studip-crawler
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
USER: 'user'
|
||||
PSWD: 'pswd'
|
||||
URL: 'https://url.tld'
|
||||
INTERVAL: 86400
|
||||
HOST: mysql
|
||||
DB_USER: root
|
||||
DB_PSWD: root
|
||||
volumes:
|
||||
- studip_data:/studip/src/data
|
||||
|
||||
mysql:
|
||||
image: mysql
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
volumes:
|
||||
- studip_db:/var/lib/mysql
|
||||
|
||||
volumes:
|
||||
studip_data:
|
||||
driver: local
|
||||
studip_db:
|
||||
driver: local
|
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
while true; do python /studip/src/run.py -o /studip/src/data -u $USER -p $PSWD -s $URL --db_user $DB_USER --db_passwd $DB_PSWD --host $HOST && sleep $INTERVAL; done
|
Loading…
Reference in new issue