nginx: recover access to the inventaire files and API

This commit is contained in:
maxlath
2025-02-27 18:19:25 +01:00
parent 5e408aad2b
commit 095293b0a5
3 changed files with 7 additions and 9 deletions

View File

@@ -10,8 +10,8 @@ services:
- couchdb - couchdb
- elasticsearch - elasticsearch
# Uncomment if you want to access the code: # Uncomment if you want to access the code:
# volumes: volumes:
# - ./inventaire/server:${PROJECT_ROOT} - ./inventaire/server:/opt/inventaire
logging: logging:
options: options:
max-size: "10m" max-size: "10m"
@@ -56,7 +56,7 @@ services:
volumes: volumes:
- ./nginx/templates:/etc/nginx/templates/ - ./nginx/templates:/etc/nginx/templates/
- ./nginx/snippets:/etc/nginx/snippets - ./nginx/snippets:/etc/nginx/snippets
- ./inventaire:${PROJECT_ROOT} - ./inventaire/server:/opt/inventaire
- certbot-www:/var/www/certbot - certbot-www:/var/www/certbot
- ./certbot/conf:/etc/letsencrypt - ./certbot/conf:/etc/letsencrypt
env_file: .env env_file: .env

3
dotenv
View File

@@ -26,9 +26,6 @@ MAILER_SMTP_PASSWORD=your_password_on_smtp.example.org
# Modify if you know what you are doing # Modify if you know what you are doing
######## ########
# Root path within docker container
PROJECT_ROOT=/opt/inventaire
NODE_ENV=production NODE_ENV=production
NODE_APP_INSTANCE=federated NODE_APP_INSTANCE=federated

View File

@@ -1,8 +1,9 @@
# PROJECT_ROOT and PUBLIC_HOSTNAME are set with nginx image function, which will extract environment variables before nginx starts # The INVENTAIRE_PORT and PUBLIC_HOSTNAME variables are set with nginx image function,
# which will extract environment variables before nginx starts
# See https://hub.docker.com/_/nginx # See https://hub.docker.com/_/nginx
upstream inventaire { upstream inventaire {
server 127.0.0.1:3006 fail_timeout=5s; server inventaire:${INVENTAIRE_PORT} fail_timeout=5s;
} }
# Using error_page as a way to have a named location that can # Using error_page as a way to have a named location that can
@@ -89,7 +90,7 @@ server {
# following aliases made in order to respect the url structure # following aliases made in order to respect the url structure
# the server alone would follow: especially, mounting /static on /public # the server alone would follow: especially, mounting /static on /public
root ${PROJECT_ROOT}/inventaire/client; root /opt/inventaire/client;
location /public/ { location /public/ {
include /etc/nginx/snippets/security_headers.conf; include /etc/nginx/snippets/security_headers.conf;
limit_except GET { limit_except GET {