From e02fa7bfd6a6439be243fde0872c1227630a3ed7 Mon Sep 17 00:00:00 2001 From: Tuan Dang Date: Wed, 23 Nov 2022 14:16:53 -0500 Subject: [PATCH] Update deployment config and docs --- .env.example | 2 +- docker-compose.dev.yml | 4 ++-- docker-compose.yml | 6 ++++-- docs/self-hosting/configuration/envars.mdx | 2 +- docs/self-hosting/deployments/linux.mdx | 4 ++-- nginx/default.conf | 4 ++-- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.env.example b/.env.example index 5f7483de7..2025622dc 100644 --- a/.env.example +++ b/.env.example @@ -33,7 +33,7 @@ MONGO_PASSWORD=example # Website URL # Required -ENV=development + SITE_URL=http://localhost:8080 # Mail/SMTP diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 494a75c0d..234fa97bd 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -31,7 +31,7 @@ services: command: npm run dev env_file: .env environment: - - NODE_ENV=${ENV} + - NODE_ENV=development networks: - infisical-dev @@ -51,8 +51,8 @@ services: - ./frontend/components:/app/components env_file: .env environment: + - NEXT_PUBLIC_ENV=production - NEXT_PUBLIC_WEBSITE_URL=${SITE_URL} - - NEXT_PUBLIC_ENV=${ENV} networks: - infisical-dev diff --git a/docker-compose.yml b/docker-compose.yml index 746362df7..648da0e3d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,7 +29,7 @@ services: command: npm run start env_file: .env environment: - - NODE_ENV=${ENV} + - NODE_ENV=production networks: - infisical @@ -45,8 +45,10 @@ services: image: infisical/frontend env_file: .env environment: + - NEXT_PUBLIC_ENV=production - NEXT_PUBLIC_WEBSITE_URL=${SITE_URL} - - NEXT_PUBLIC_ENV=${ENV} + - NEXT_PUBLIC_POSTHOG_HOST=${POSTHOG_HOST} + - NEXT_PUBLIC_POSTHOG_API_KEY=${POSTHOG_PROJECT_API_KEY} networks: - infisical diff --git a/docs/self-hosting/configuration/envars.mdx b/docs/self-hosting/configuration/envars.mdx index 376df85fe..16d81d1ed 100644 --- a/docs/self-hosting/configuration/envars.mdx +++ b/docs/self-hosting/configuration/envars.mdx @@ -22,7 +22,7 @@ Configuring Infisical requires setting some environment variables. There is a fi | `MONGO_URL` | ❗️ MongoDB instance connection string either to container instance or MongoDB Cloud | `None` | | `MONGO_USERNAME` | MongoDB username if using container | `None` | | `MONGO_PASSWORD` | MongoDB password if using container | `None` | -| `NODE_ENV` | ❗️ `production` or `development` | `None` | +| `ENV` | ❗️ `production` or `development` | `None` | | `SITE_URL` | ❗️ Site URL - should be an absolute URL including the protocol (e.g. `https://app.infisical.com`) | `None` | | `SMT_HOST` | Whether the user joined the community | `smtp.gmail.com` | | `SMTP_NAME` | ❗️ Whether the user joined the community | `None` | diff --git a/docs/self-hosting/deployments/linux.mdx b/docs/self-hosting/deployments/linux.mdx index a0c59d0e4..e3392e6c3 100644 --- a/docs/self-hosting/deployments/linux.mdx +++ b/docs/self-hosting/deployments/linux.mdx @@ -33,7 +33,7 @@ wget -O .env https://raw.githubusercontent.com/Infisical/infisical/main/.env.exa wget -O docker-compose.yml https://raw.githubusercontent.com/Infisical/infisical/main/docker-compose.yml # Download nginx config -mkdir nginx && cd nginx && wget -O default.conf https://raw.githubusercontent.com/Infisical/infisical/main/nginx/default.conf +mkdir nginx && cd nginx && wget -O default.conf https://raw.githubusercontent.com/Infisical/infisical/main/nginx/default.dev.conf cd .. ``` @@ -51,4 +51,4 @@ nano .env docker-compose -f docker-compose.yml up -d ``` -5. Your Infisical installation is complete and should be running on ports 40 and 443. Please note that the containers are not exposed to the internet and only bind to the localhost. It's up to you to configure a firewall, SSL certificates, and implement any additional security measures. +5. Your Infisical installation is complete and should be running on port 8080. Please note that the containers are not exposed to the internet and only bind to the localhost. It's up to you to configure a firewall, SSL certificates, and implement any additional security measures. diff --git a/nginx/default.conf b/nginx/default.conf index 3d0f92ba5..37df4acb7 100644 --- a/nginx/default.conf +++ b/nginx/default.conf @@ -2,7 +2,7 @@ server { listen 80; listen [::]:80; - server_name api.infisical.com; + server_name your.domain.com; return 302 https://$server_name$request_uri; } @@ -11,7 +11,7 @@ server { listen 443 default_server ssl http2; listen [::]:443 ssl http2; - server_name api.infiscal.com; + server_name your.domain.com; ssl_certificate /etc/ssl/cert.pem; ssl_certificate_key /etc/ssl/cert.key;