client and server are integrated now

This commit is contained in:
Pagwin 2025-04-02 16:59:07 -04:00
parent dc9a3b0e1d
commit 174a9665dc
No known key found for this signature in database
GPG key ID: 81137023740CA260
6 changed files with 29 additions and 14 deletions

2
src/client/.dockerignore Normal file
View file

@ -0,0 +1,2 @@
Dockerfile
.dockerignore

View file

@ -4,7 +4,7 @@ RUN mkdir /client
RUN apk add bash curl file git unzip which zip gcompat wget tar xz
ENTRYPOINT bash
#ENTRYPOINT bash
WORKDIR /client
@ -12,8 +12,6 @@ RUN wget -O flutter.tar.xz https://storage.googleapis.com/flutter_infra_release/
RUN tar xf flutter.tar.xz
RUN echo `ls`
ENV PATH="/client/flutter/bin/:${PATH}"
RUN git config --global --add safe.directory /client/flutter
@ -22,10 +20,12 @@ RUN flutter upgrade
RUN flutter doctor
COPY ./* /client/
COPY ./ /client/
RUN flutter build web
WORKDIR /client/build/web
CMD ["dart", "run", "dhttpd"]
EXPOSE 80/tcp
CMD ["dart", "run", "dhttpd", "--host", "0.0.0.0", "--port", "80"]

View file

@ -14,6 +14,7 @@ dependencies:
http: ^1.3.0
dev_dependencies:
dhttpd: ^4.1.0
flutter_test:
sdk: flutter
very_good_analysis: ^6.0.0

View file

@ -1,7 +1,17 @@
services:
rev_proxy:
build: ./reverse-proxy
ports:
- "127.0.0.1:8080:80"
depends_on:
- server
- client
restart: unless-stopped
client:
build: ./client
restart: unless-stopped
server:
build: ./server
environment:
@ -10,7 +20,8 @@ services:
# - "127.0.0.1:8080:80"
restart: unless-stopped
depends_on:
- neo4j
neo4j:
condition: service_healthy
neo4j:
image: neo4j:latest
volumes:
@ -18,19 +29,19 @@ services:
- neo4jdata:/data
- neo4jplugins:/plugins
environment:
# neo4j isn't exposed to the internet so having the password checked into version control doesn't matter
- NEO4J_AUTH=neo4j/your_password
ports:
# useful for dev
- "127.0.0.1:7474:7474"
- "127.0.0.1:7687:7687"
restart: unless-stopped
rev_proxy:
build: ./reverse-proxy
ports:
- "127.0.0.1:8080:80"
depends_on:
- server
restart: unless-stopped
healthcheck:
test: wget http://localhost:7474 || exit 1
interval: 1s
timeout: 10s
retries: 20
start_period: 3s
volumes:
neo4jconfig:

View file

@ -1,4 +1,5 @@
:80 {
reverse_proxy client:80
handle_path /api/* {
reverse_proxy server:80
}

View file

@ -29,7 +29,7 @@ const graph_driver = neo4j.driver(
neo4j.auth.basic("neo4j", "your_password"),
);
console.log("initializing graph with static data");
graph_setup(graph_driver);
await graph_setup(graph_driver);
console.log("graph initialization complete");
const db = new DatabaseSync(":memory:");