Use nginx server to host files and handle page reloads
This commit is contained in:
parent
6b575f7576
commit
746447f5fc
@ -12,19 +12,19 @@ services:
|
||||
- ../config/osmosis/build-app.sh:/app/packages/web/build-app.sh
|
||||
- app_builds:/app-builds
|
||||
|
||||
python-server:
|
||||
image: python:3
|
||||
nginx:
|
||||
image: nginx:1.23-alpine
|
||||
restart: always
|
||||
depends_on:
|
||||
osmosis-front-end:
|
||||
condition: service_completed_successfully
|
||||
restart: on-failure
|
||||
command: ["python3", "-m", "http.server", "-d" ,"/app-builds/osmosis/build", "3000"]
|
||||
volumes:
|
||||
- app_builds:/app-builds
|
||||
- ../config/osmosis/nginx:/etc/nginx/conf.d
|
||||
- app_builds:/usr/share/nginx
|
||||
ports:
|
||||
- "3000"
|
||||
- "80"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "localhost", "3000"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "80"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
|
||||
16
stack_orchestrator/data/config/osmosis/nginx/web-app.conf
Normal file
16
stack_orchestrator/data/config/osmosis/nginx/web-app.conf
Normal file
@ -0,0 +1,16 @@
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
server_name _;
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
|
||||
location / {
|
||||
root /usr/share/nginx/osmosis/build;
|
||||
index index.html index.htm index.nginx-debian.html;
|
||||
|
||||
# First attempt to serve request as file, then as html,
|
||||
# then as directory, then fall back to displaying a 404.
|
||||
try_files $uri $uri.html $uri/ /index.html =404;
|
||||
}
|
||||
}
|
||||
@ -42,8 +42,8 @@ network:
|
||||
ports:
|
||||
proxy-server:
|
||||
- '4000:4000'
|
||||
python-server:
|
||||
- '3000:3000'
|
||||
niginx:
|
||||
- '3000:80'
|
||||
```
|
||||
|
||||
### Data volumes
|
||||
|
||||
Loading…
Reference in New Issue
Block a user