Commit 6d834800 authored by Fotis Paraskevopoulos's avatar Fotis Paraskevopoulos
Browse files

redirecting logs on Dockerfile

parent 539ff450
......@@ -10,17 +10,21 @@ COPY . /app
ADD https://gitlab.ow2.org/melodic/morphemic-preprocessor/-/archive/morphemic-rc1.5/morphemic-preprocessor-morphemic-rc1.5.tar.gz /var/lib/morphemic/
RUN cd /var/lib/morphemic/ \
&& tar -zxf morphemic-preprocessor-morphemic-rc1.5.tar.gz \
&& rm -rf /app/messaging \
&& cp -R /var/lib/morphemic/morphemic-preprocessor-morphemic-rc1.5/amq-message-python-library /app/messaging \
&& rm -rf /var/lib/morphemic
COPY docker-entrypoint.sh /app
WORKDIR /app
RUN pip3 install -r requirements.txt \
&& pip3 install -r messaging/requirements.txt
&& pip3 install -r messaging/requirements.txt \
&& chmod +x /app/docker-entrypoint.sh
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["python3","main.py"]
\ No newline at end of file
CMD ["python3", "main.py"]
\ No newline at end of file
#!/bin/sh
mkdir -p /logs
touch /logs/eshybrid.log
"$@" > /logs/eshybrid.log 2>&1
......@@ -4,25 +4,27 @@ import os
import argparse
from forecasting import eshybrid
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
def main():
parser = argparse.ArgumentParser(description='Run eshybrid forecaster')
parser.add_argument('--config', help='Config file to run, default sync.cfg')
parser = argparse.ArgumentParser(description='Run eshybrid forecaster')
parser.add_argument('--config', help='Config file to run, default sync.cfg')
args = parser.parse_args()
args = parser.parse_args()
config_file = "%s/%s" % (os.getcwd(), args.config or "sync.cfg")
print("Config file %s ", config_file)
config = configparser.RawConfigParser()
config.read(config_file)
config_dict = dict(config)
config_file = "%s/%s" % (os.getcwd(), args.config or "sync.cfg")
print("Config file %s ", config_file)
config = configparser.RawConfigParser()
config.read(config_file)
config_dict = dict(config)
e = eshybrid.ESHybrid(config)
e = eshybrid.ESHybrid(config)
try:
e.start()
except KeyboardInterrupt:
e.stop()
try:
e.start()
except KeyboardInterrupt:
e.stop()
if __name__ == '__main__':
main()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment