From 9cb4d5abb7aa05fce2ac4ee9dbe41c2031d0c0cc Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Tue, 9 May 2023 22:02:05 -0400 Subject: [PATCH] improve docker compose and add standalone docs --- docs/mint.json | 2 +- .../deployment-options/docker-compose.mdx | 15 ++-- .../standalone-infisical.mdx | 69 ++++++++++++++++++- 3 files changed, 79 insertions(+), 7 deletions(-) diff --git a/docs/mint.json b/docs/mint.json index 9e982881f..092535b8e 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -123,9 +123,9 @@ "self-hosting/deployment-options/kubernetes-helm", "self-hosting/deployment-options/aws-ec2", "self-hosting/deployment-options/docker-compose", + "self-hosting/deployment-options/standalone-infisical", "self-hosting/deployment-options/fly.io", "self-hosting/deployment-options/render", - "self-hosting/deployment-options/standalone-infisical", "self-hosting/deployment-options/digital-ocean-marketplace" ] }, diff --git a/docs/self-hosting/deployment-options/docker-compose.mdx b/docs/self-hosting/deployment-options/docker-compose.mdx index ca2219344..979c1ec47 100644 --- a/docs/self-hosting/deployment-options/docker-compose.mdx +++ b/docs/self-hosting/deployment-options/docker-compose.mdx @@ -3,7 +3,7 @@ title: "Docker Compose" description: "Learn to install Infisical using our Docker Compose template" --- -1. Install Docker on your VM +## Install Docker on your VM ```bash # Example in ubuntu @@ -12,7 +12,7 @@ apt-get upgrade apt install docker-compose ``` -2. Download the required files +## Download the required files ```bash # Download env file template @@ -25,18 +25,23 @@ wget -O docker-compose.yml https://raw.githubusercontent.com/Infisical/infisical mkdir nginx && wget -O ./nginx/default.conf https://raw.githubusercontent.com/Infisical/infisical/main/nginx/default.dev.conf ``` -3. Tweak the `.env` according to your preferences. Refer to the available [environment variables](/self-hosting/configuration/envars) +## Update .env file +Tweak the `.env` according to your preferences. Refer to the available [environment variables](/self-hosting/configuration/envars) ```bash # update environment variables like mongo login nano .env ``` -4. Get the service up and running. + + Infisical assumes that you have configured HTTPS. If you didn't configure HTTPS, set `HTTPS_ENABLED` to `false` in the .env file to avoid frequent logouts. + + +## Get the service up and running. ```bash # Start up services in detached mode docker-compose -f docker-compose.yml up -d ``` -5. Your Infisical installation is complete and should be running on [http://localhost:80](http://localhost:80). 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. +Your Infisical installation is complete and should be running on [http://localhost:80](http://localhost:80). 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/docs/self-hosting/deployment-options/standalone-infisical.mdx b/docs/self-hosting/deployment-options/standalone-infisical.mdx index b338c708a..61cdac62f 100644 --- a/docs/self-hosting/deployment-options/standalone-infisical.mdx +++ b/docs/self-hosting/deployment-options/standalone-infisical.mdx @@ -3,4 +3,71 @@ title: "Docker" description: "Learn to install Infisical purely on docker" --- -Documentation coming soon \ No newline at end of file +The Infisical standalone version combines all the essential components of the application into a single container, making deployment and management more straightforward than using Kubernetes or Docker Compose. + +Since all the components are bundled into one image, running this version of Infisical requires a minimum of **230MB of memory**. + +This guide assumes you have basic knowledge of Docker and have it installed on your system. If you don't have Docker installed, please follow the official installation guide: https://docs.docker.com/get-docker/ + +## Pull the Infisical Docker image + +Open your terminal or command prompt and enter the following command to pull the Infisical Docker image: + +``` +docker pull infisical/infisical:latest +``` + +## Create a .env file +The Infisical Docker image requires a .env file to manage environment variables. +Create a new file called .env in your preferred location. Add the required environment variables listed below. View [all configurable environment variables](../configuration/envars) + + + Must be a random 16 byte hex string. Can be generated with `openssl rand -hex 16` + + + + Must be a random 16 byte hex string. Can be generated with `openssl rand -hex 16` + + + + Must be a random 16 byte hex string. Can be generated with `openssl rand -hex 16` + + + + Must be a random 16 byte hex string. Can be generated with `openssl rand -hex 16` + + + + Must be a random 16 byte hex string. Can be generated with `openssl rand -hex 16` + + + + *TLS based connection string is not yet supported + + + +```env .example-env +ENCRYPTION_KEY=f40c9178624764ad85a6830b37ce239a +JWT_SIGNUP_SECRET=38ea90fb7998b92176080f457d890392 +JWT_REFRESH_SECRET=7764c7bbf3928ad501591a3e005eb364 +JWT_AUTH_SECRET=5239fea3a4720c0e524f814a540e14a2 +JWT_SERVICE_SECRET=8509fb8b90c9b53e9e61d1e35826dcb5 +MONGO_URL=<> +``` + + + The sample environment variables listed above are only to be used as an example and should not be used in production + + +## Run the Infisical Docker container: + +In the terminal or command prompt, navigate to the directory containing the .env file you created. Run the following command to start the Infisical Docker container: + +``` +docker run --name infisical-app --env-file ./.env -p 80:80 infisical/infisical:latest +``` + +This command will create a new container named infisical-app using the Infisical Docker image. It will also load the environment variables from the .env file and map the container's port 80 to the host's port 80. + +## Verify the installation: +Once the container is running, open a web browser and navigate to http://localhost:80. That's it! You have successfully installed the Infisical application using a single Docker image. \ No newline at end of file