feat: add nginx reverse proxy configuration
This commit is contained in:
@@ -21,3 +21,8 @@ SMTP_DOMAIN="domain.com"
|
|||||||
SMTP_PORT=465
|
SMTP_PORT=465
|
||||||
SMTP_FROM="Company CO"
|
SMTP_FROM="Company CO"
|
||||||
SMTP_EMAIL="domain@domain.com"
|
SMTP_EMAIL="domain@domain.com"
|
||||||
|
|
||||||
|
# NGINX
|
||||||
|
SERVER_NAME=tryton.domain.com
|
||||||
|
NGINX_PORT=10000
|
||||||
|
VARIABLE=$
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ services:
|
|||||||
TRYTOND_DATABASE_URI: ${TRYTOND_DATABASE_URI:-postgresql://${POSTGRES_USER:-naliia}:${POSTGRES_PASSWORD:-SUp3r-pass*DB}@${DB_HOSTNAME:-db}:5432/}
|
TRYTOND_DATABASE_URI: ${TRYTOND_DATABASE_URI:-postgresql://${POSTGRES_USER:-naliia}:${POSTGRES_PASSWORD:-SUp3r-pass*DB}@${DB_HOSTNAME:-db}:5432/}
|
||||||
NALIIA_IMAGE: ${NALIIA_IMAGE:-gitea.onecluster.org/aserrador/naliia:latest}
|
NALIIA_IMAGE: ${NALIIA_IMAGE:-gitea.onecluster.org/aserrador/naliia:latest}
|
||||||
EMAIL: ${EMAIL:-admin@admin.org}
|
EMAIL: ${EMAIL:-admin@admin.org}
|
||||||
ports:
|
|
||||||
- "${TRYTON_PORT:-8000}:8000"
|
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -71,6 +69,18 @@ services:
|
|||||||
TRYTOND_DATABASE_URI: ${TRYTOND_DATABASE_URI:-postgresql://${POSTGRES_USER:-naliia}:${POSTGRES_PASSWORD:-SUp3r-pass*DB}@${DB_HOSTNAME:-db}:5432/}
|
TRYTOND_DATABASE_URI: ${TRYTOND_DATABASE_URI:-postgresql://${POSTGRES_USER:-naliia}:${POSTGRES_PASSWORD:-SUp3r-pass*DB}@${DB_HOSTNAME:-db}:5432/}
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
|
nginx:
|
||||||
|
image: nginx:1.23.3
|
||||||
|
volumes:
|
||||||
|
- ./nginx.conf:/etc/nginx/conf.d/nginx.conf.template
|
||||||
|
ports:
|
||||||
|
- "${NGINX_PORT:-10000}:${NGINX_PORT:-10000}"
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
depends_on:
|
||||||
|
- tryton
|
||||||
|
- db
|
||||||
|
command: /bin/bash -c "envsubst < /etc/nginx/conf.d/nginx.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres:
|
postgres:
|
||||||
|
|||||||
19
nginx.conf
Normal file
19
nginx.conf
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
server {
|
||||||
|
server_name ${SERVER_NAME};
|
||||||
|
listen ${NGINX_PORT};
|
||||||
|
client_max_body_size 8M;
|
||||||
|
|
||||||
|
sendfile on;
|
||||||
|
send_timeout 500s;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://tryton:8000/; # "trytond" is the service name of another Docker container on port 8000
|
||||||
|
proxy_read_timeout 500;
|
||||||
|
proxy_connect_timeout 500;
|
||||||
|
proxy_send_timeout 500;
|
||||||
|
proxy_set_header Host ${VARIABLE}host;
|
||||||
|
proxy_set_header X-Real-IP ${VARIABLE}remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For ${VARIABLE}proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Host ${VARIABLE}server_name;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user