Skip to content

Commit

Permalink
also adding mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
amaldonadomat committed Feb 20, 2024
1 parent 264ca3c commit 8e14c33
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
17 changes: 12 additions & 5 deletions client/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -39,22 +39,25 @@ 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.
# resolver 127.0.0.11;

# 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;

Expand All @@ -66,5 +69,9 @@ http {
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}

location / {
try_files $uri $uri/ /index.html;
}
}
}
21 changes: 8 additions & 13 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 [email protected] --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

0 comments on commit 8e14c33

Please sign in to comment.