From 8e14c33a5d8aa75fbd572da74f9e3daaed18510d Mon Sep 17 00:00:00 2001 From: Alvaro Maldonado Mateos Date: Tue, 20 Feb 2024 10:53:49 +0100 Subject: [PATCH] also adding mongo --- client/nginx.conf | 17 ++++++++++++----- docker-compose.yaml | 21 ++++++++------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/client/nginx.conf b/client/nginx.conf index e1843e6..a085e07 100644 --- a/client/nginx.conf +++ b/client/nginx.conf @@ -25,7 +25,7 @@ http { # Since this is the default (and only server) we don't need a # valid server_name. _ is convention. - server_name _; + server_name substrait-fiddle.com; # Don't send nginx version in error pages. Not really needed. server_tokens off; @@ -39,11 +39,14 @@ http { proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } + + location / { + try_files $uri $uri/ /index.html; + } } server { listen 443 ssl; - listen [::]:443; # Ideally, should figure this out. I believe it to be specific # to the environment. @@ -51,10 +54,10 @@ http { # Since this is the default (and only server) we don't need a # valid server_name. _ is convention. - server_name substrait-fiddle.com www.substrait-fiddle.com; + server_name substrait-fiddle.com; - ssl_certificate /etc/letsencrypt/live/tu_dominio.com/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/tu_dominio.com/privkey.pem + ssl_certificate /etc/letsencrypt/live/substrait-fiddle.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/substrait-fiddle.com/privkey.pem; root /app/static; @@ -66,5 +69,9 @@ http { proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } + + location / { + try_files $uri $uri/ /index.html; + } } } diff --git a/docker-compose.yaml b/docker-compose.yaml index f6b4675..6c10e5a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,9 +8,9 @@ services: environment: - DUCKDB_POOL_SIZE=5 - VITE_SESSION_SECRET=$VITE_SESSION_SECRET + - PROD_MONGO_URL=mongodb://mongo:27017/ networks: - fiddle-network - client: build: context: ./client @@ -24,18 +24,13 @@ services: environment: - NODE_ENV=production volumes: - - ./nginx/certbot/conf:/etc/letsencrypt - - ./nginx/certbot/www:/var/www/certbot - depends_on: - - certbot - certbot: - image: certbot/certbot - volumes: - - ./nginx/certbot/conf:/etc/letsencrypt - - ./nginx/certbot/www:/var/www/certbot - entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'" - command: certonly --webroot --webroot-path=/var/www/certbot --email eng-oss-ops@voltrondata.com --agree-tos --no-eff-email --staging -d substrait-fiddle.com -d www.substrait-fiddle.com - + - /etc/letsencrypt:/etc/letsencrypt + mongo: + image: mongo + ports: + - "27017:27017" + networks: + - fiddle-network networks: fiddle-network: driver: bridge