diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..cd0e393d48ee01384e0da2586393eeafdfd5dee4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,36 @@ +FROM ubuntu:latest +MAINTAINER ETSI CTI "cti_support@etsi.org" + +ENV TZ=Europe/Paris +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update -y \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + locales \ + python3-pip \ + python3-dev \ + build-essential \ + python3-tosca-parser \ + && cd /usr/local/bin \ + && ln -s /usr/bin/python3 python \ + && pip3 install --upgrade pip + +RUN sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen && locale-gen + +RUN echo "export LC_ALL=en_US.UTF-8" >> ~/.bashrc +RUN echo "export LANG=en_US.UTF-8" >> ~/.bashrc +RUN echo "export LANGUAGE=en_US.UTF-8" >> ~/.bashrc + +COPY /src /app +COPY requirements.txt /app/ +WORKDIR /app +RUN pip install -r requirements.txt + +RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ + locale-gen +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 + +ENTRYPOINT ["python"] +CMD ["web_app.py"] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..f8067ae1d0649643a43052e01b76f4b572703188 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +Flask==0.10.1 +python-docx \ No newline at end of file diff --git a/config.py b/src/config.py similarity index 100% rename from config.py rename to src/config.py diff --git a/doc2tosca.py b/src/doc2tosca.py similarity index 100% rename from doc2tosca.py rename to src/doc2tosca.py diff --git a/templates/home.html b/src/templates/home.html similarity index 100% rename from templates/home.html rename to src/templates/home.html diff --git a/tosca2doc.py b/src/tosca2doc.py similarity index 100% rename from tosca2doc.py rename to src/tosca2doc.py diff --git a/web_app.py b/src/web_app.py similarity index 98% rename from web_app.py rename to src/web_app.py index 0c8c6174a48a3234dc597399cf4a9f871ef46cdc..27be46609a63baa4fe74fcf794df6e8778b30e4e 100644 --- a/web_app.py +++ b/src/web_app.py @@ -134,3 +134,6 @@ def mk_doc2tosca(): archive.write(myfile, arcname=os.path.basename(myfile)) return send_file(zip_path, as_attachment=True) + +if __name__ == '__main__': + app.run(debug=True,host='0.0.0.0') \ No newline at end of file