main
ifiguero 2024-03-10 02:06:29 -03:00
parent 0a7cc2a763
commit a771c04b7c
3 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,7 @@
FROM dev.ilab.cl/tdtp/tdtp_admin:latest
COPY background_gtfs.py /srv/gtfs_feed.py
ENTRYPOINT ["python3"]
CMD ["/srv/gtfs_feed.py"]

19
background_gtfs.py 100644
View File

@ -0,0 +1,19 @@
# coding: utf-8
import logging
import os
import time
if __name__ == '__main__':
while True:
o, e = procesa_zip()
print(o)
print(e)
time.sleep(os.environ.get('INTERVAL'))
def procesa_zip():
import subprocess
cmd = subprocess.Popen([u"/usr/bin/python /srv/project/manage.py procesa_zip"], shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
cmd.wait()
return (cmd.stdout, cmd.stderr)

View File

@ -102,6 +102,21 @@ services:
# tag: "{{.Name}}"
tdtp-ingester:
build:
dockerfile: Dockerfile.gtfs_feed
image: dev.ilab.cl/tdtp/tdtp_gtfs_feed:latest
ports:
- 4030:4000
environment:
- PORT=4000
- DBHOST=db
- DBPORT=4080
- DBNAME=database
- DBSCHEMA=desarrollo1
- DBUSER=postgres
- DBPASS=password
tdtp-proto:
build:
dockerfile: Dockerfile.proto