Skip to content

Commit

Permalink
adding container startup scripts for neo4j and flask
Browse files Browse the repository at this point in the history
  • Loading branch information
njfio committed Aug 22, 2024
1 parent ed3b95f commit 35ec825
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 11 deletions.
26 changes: 17 additions & 9 deletions fluent-env/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN apk add neo4j
# Install dependencies
RUN apk add --no-cache build-base bash git curl wget python3 python3-dev py3-pip \
ruby ruby-dev ruby-irb ruby-rdoc ruby-json ruby-bigdecimal

RUN apk add screen

# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
Expand All @@ -31,18 +31,24 @@ RUN cp ~/.cargo/git/checkouts/fluent_cli-*/*/front_end_index.html /app/index.htm

RUN mkdir /.fluent/
RUN mkdir /.fluent/state_store/
RUN mkdir /.fluent/example_configurations/

RUN cp ~/.cargo/git/checkouts/fluent_cli-*/*/default_config_test.json /.fluent/
RUN cp ~/.cargo/git/checkouts/fluent_cli-*/*/fluent_autocomplete.sh /.fluent/
RUN cp ~/.cargo/git/checkouts/fluent_cli-*/*/amber.yaml /.fluent/
RUN cp ~/.cargo/git/checkouts/fluent_cli-*/*/fluent-env /.fluent/

RUN cp ~/.cargo/git/checkouts/fluent_cli-*/*/fluent-env/start-neo4j.sh /.fluent/
RUN chmod +x /.fluent/start-neo4j.sh
RUN cp ~/.cargo/git/checkouts/fluent_cli-*/*/fluent-env/start-flask.sh /.fluent/
RUN chmod +x /.fluent/start-flash.sh

RUN cp ~/.cargo/git/checkouts/fluent_cli-*/*/example_configurations/*.json /.fluent/example_configurations


EXPOSE 5000
EXPOSE 7474
EXPOSE 7687

WORKDIR /app
RUN echo "dbms.default_database=neo4j" >> /etc/neo4j/neo4j.conf
RUN echo "dbms.connector.bolt.enabled=true" >> /etc/neo4j/neo4j.conf
RUN echo "dbms.connector.bolt.listen_address=:7687" >> /etc/neo4j/neo4j.conf
Expand All @@ -51,15 +57,17 @@ RUN echo "dbms.default_listen_address=0.0.0.0" >> /etc/neo4j/neo4j.conf

RUN neo4j-admin set-default-admin neo4j
RUN neo4j-admin set-initial-password system2024!
RUN neo4j start &


CMD ["/.fluent/start-neo4j.sh"]
CMD ["/.fluent/start-flask.sh"]
#CMD ["python", "app.py", "&"]


#RUN python -m flask run --host=0.0.0.0 --port=5000 &
#CMD ["python3", "app.py"]

# Set up Entrypoint
ENTRYPOINT ["/.fluent/start-neo4j.sh"]



WORKDIR /app
ENTRYPOINT ["bash"]

RUN echo "source /.fluent/fluent_autocomplete.sh" >> ~/.bashrc
6 changes: 6 additions & 0 deletions fluent-env/start-flask.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# Start the web server
screen -d -m flask python /app/app.py

echo "started web server"
3 changes: 1 addition & 2 deletions fluent-env/start-neo4j.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
# Start Neo4j in the background
neo4j start &

# Run the bash shell
bash
echo "started neo4j server"

0 comments on commit 35ec825

Please sign in to comment.