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 RUN apk add bash curl file git unzip which zip gcompat wget tar xz
ENTRYPOINT bash #ENTRYPOINT bash
WORKDIR /client 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 tar xf flutter.tar.xz
RUN echo `ls`
ENV PATH="/client/flutter/bin/:${PATH}" ENV PATH="/client/flutter/bin/:${PATH}"
RUN git config --global --add safe.directory /client/flutter RUN git config --global --add safe.directory /client/flutter
@ -22,10 +20,12 @@ RUN flutter upgrade
RUN flutter doctor RUN flutter doctor
COPY ./* /client/ COPY ./ /client/
RUN flutter build web RUN flutter build web
WORKDIR /client/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 http: ^1.3.0
dev_dependencies: dev_dependencies:
dhttpd: ^4.1.0
flutter_test: flutter_test:
sdk: flutter sdk: flutter
very_good_analysis: ^6.0.0 very_good_analysis: ^6.0.0

View file

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

View file

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

View file

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