Skip to content

Commit

Permalink
Serve frontend statically
Browse files Browse the repository at this point in the history
  • Loading branch information
mental32 committed Jul 11, 2024
1 parent 18bb963 commit 839f587
Show file tree
Hide file tree
Showing 33 changed files with 377 additions and 4,857 deletions.
21 changes: 1 addition & 20 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,12 @@ services:
- CONFIG_FILE_PATH=/etc/exchange/conf.toml
- BITCOIN_RPC_URL=http://bitcoind:8332
depends_on:
- redis
- postgres
- bitcoind
- bitcoind-grpc-proxy
restart: on-failure # Restart the service if it fails
stop_signal: SIGINT # Stop the service gracefully

exchange-frontend:
image: exchange-orderbook-frontend:latest
build:
context: .
dockerfile: ./frontend/Dockerfile.frontend
environment:
- PORT=3030
ports:
- "3030:3030"
networks:
- exchange-net
depends_on:
- exchange
restart: on-failure
develop:
watch:
- action: rebuild
path: ./frontend/

bitcoind-grpc-proxy:
image: exchange-orderbook:latest
build:
Expand Down Expand Up @@ -76,6 +56,7 @@ services:
volumes:
- ./etc/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./etc/letsencrypt/:/etc/letsencrypt:ro
- ./frontend/:/www:ro
networks:
- exchange-net
depends_on:
Expand Down
14 changes: 4 additions & 10 deletions etc/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ http {
server exchange:3000;
}

upstream frontend {
server exchange-frontend:3030;
}

server {
listen 80;

Expand All @@ -26,7 +22,7 @@ http {
listen 443 ssl;

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'; " always;
# add_header Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'; " always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer" always;
Expand All @@ -38,11 +34,9 @@ http {
ssl_prefer_server_ciphers on;

location / {
proxy_pass http://frontend;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
root /www/;
index app.html;
sendfile on;
}

location /api {
Expand Down
13 changes: 0 additions & 13 deletions frontend/.eslintignore

This file was deleted.

14 changes: 0 additions & 14 deletions frontend/.eslintrc.cjs

This file was deleted.

10 changes: 0 additions & 10 deletions frontend/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion frontend/.npmrc

This file was deleted.

13 changes: 0 additions & 13 deletions frontend/.prettierignore

This file was deleted.

8 changes: 0 additions & 8 deletions frontend/.prettierrc

This file was deleted.

15 changes: 0 additions & 15 deletions frontend/Dockerfile.frontend

This file was deleted.

38 changes: 0 additions & 38 deletions frontend/README.md

This file was deleted.

Loading

0 comments on commit 839f587

Please sign in to comment.