Skip to content

Commit

Permalink
more front end changes
Browse files Browse the repository at this point in the history
  • Loading branch information
njfio committed Aug 21, 2024
1 parent 8be6802 commit 69bfcb4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
10 changes: 6 additions & 4 deletions fluent-env/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ RUN apk add py3-flask
RUN mkdir /app
RUN mkdir /app/frontend

RUN cp ~/.cargo/git/checkouts/fluent_cli-*/*/frontend.py /app/frontend/app.py
RUN cp ~/.cargo/git/checkouts/fluent_cli-*/*/frontend.py /app/app.py
RUN cp ~/.cargo/git/checkouts/fluent_cli-*/*/front_end_index.html /app/frontend/index.html

EXPOSE 5000

CMD ["flask", "run", "--host=0.0.0.0"]

RUN mkdir /.fluent/
RUN cp ~/.cargo/git/checkouts/fluent_cli-*/*/default_config_test.json /.fluent/
Expand All @@ -36,4 +34,8 @@ RUN cp ~/.cargo/git/checkouts/fluent_cli-*/*/amber.yaml /.fluent/

# Set up Entrypoint
ENTRYPOINT ["bash"]
RUN echo "source /.fluent/fluent_autocomplete.sh" >> ~/.bashrc
RUN echo "source /.fluent/fluent_autocomplete.sh" >> ~/.bashrc

EXPOSE 5000
WORKDIR /app
CMD ["python", "-m", "flask", "run", "--host=0.0.0.0"]
7 changes: 6 additions & 1 deletion frontend.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from flask import Flask, request, jsonify
import subprocess
import logging
import os

app = Flask(__name__, static_url_path='', static_folder='frontend')

Expand All @@ -17,4 +19,7 @@ def execute_fluent():
return jsonify({'error': str(e)})

if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')
logging.debug("Flask app starting...")
logging.debug(f"Working directory: {os.getcwd()}")
logging.debug(f"Environment variables: {os.environ}")
app.run(debug=True, host='0.0.0.0')

0 comments on commit 69bfcb4

Please sign in to comment.