Phala Network Docs
  • Home
    • šŸ‘¾Phala Network Docs
  • Overview
    • āš–ļøPhala Network
      • šŸ’ŽPhala Cloud
      • 🄷Dstack
      • šŸ”GPU TEE
    • šŸ’ŽPHA Token
      • šŸŖ™Introduction
      • šŸ‘Delegation
        • Delegate to StakePool
        • What is Vault
        • What is Share
        • WrappedBalances & W-PHA
        • Examples of Delegation
        • Use Phala App to Delegate
        • Estimate Your Reward
      • šŸ—³ļøGovernance
        • Governance Mechanism
        • Join the Council
        • Voting for Councillors
        • Apply for Project Funding
        • Phala Treasury
        • Phala Governance
        • Setting Up an Account Identity
  • Phala Cloud
    • šŸš€Getting Started
      • Create Your Phala Cloud Account
      • Your First CVM Deployment
      • Explore Templates
        • Launch an Eliza Agent
        • Start from Template
    • 🪨TEEs, Attestation & Zero Trust Security
      • Attestation
      • Security Architecture
    • 🄷Phala Cloud User Guides
      • Deploy and Manage CVMs
        • Deploy CVM with Docker Compose
        • Set Secure Environment Variables
        • Deploy Private Docker Image to CVM
        • Debugging and Analyzing Logs
          • Check Logs
          • Private Log Viewer
          • Debug Your Application
        • Application Scaling & Resource Management
        • Upgrade Application
        • Deployment Cheat Sheet
      • Building with TEE
        • Access Your Applications
        • Expose Service Port
        • Setting Up Custom Domain
        • Secure Access Database
        • Create Crypto Wallet
        • Generate Remote Attestation
      • Advanced Deployment Options
        • Deploy CVM with Phala Cloud CLI
        • Deploy CVM with Phala Cloud API
        • Setup a CI/CD Pipeline
    • 🚢Be Production Ready
      • CI/CD Automation
        • Setup a CI/CD Pipeline
      • Production Checklist
      • Troubleshooting Guide
      • Glossary
    • šŸ”’Use Cases
      • TEE with AI
      • TEE with FHE and MPC
      • TEE with ZK and ZKrollup
    • šŸ“‹References
      • Phala Cloud CLI Reference
        • phala
          • auth
          • cvms
          • docker
          • simulator
      • Phala Cloud API & SDKs
        • API Endpoints & Examples
        • SDKs and Integrations
      • Phala Cloud Pricing
    • ā“FAQs
  • Dstack
    • Overview
    • Getting Started
    • Hardware Requirements
    • Design Documents
      • Decentralized Root-of-Trust
      • Key Management Service
      • Zero Trust HTTPs (TLS)
    • Acknowledgement
  • LLM in GPU TEE
    • šŸ‘©ā€šŸ’»Host LLM in GPU TEE
    • šŸ”GPU TEE Inference API
    • šŸŽļøGPU TEE Benchmark
  • Tech Specs
    • ā›“ļøBlockchain
      • Blockchain Entities
      • Cluster of Workers
      • Secret Key Hierarchy
  • References
    • šŸ”Setting Up a Wallet on Phala
      • Acquiring PHA
    • šŸŒ‰SubBridge
      • Cross-chain Transfer
      • Supported Assets
      • Asset Integration Guide
      • Technical Details
    • šŸ‘·Community Builders
    • 🤹Hackathon Guides
      • ETHGlobal Singapore
      • ETHGlobal San Francisco
      • ETHGlobal Bangkok
    • 🤯Advanced Topics
      • Cross Chain Solutions
      • System Contract and Drivers
      • Run Local Testnet
      • SideVM
    • šŸ†˜Support
      • Available Phala Chains
      • Resource Limits
      • Transaction Costs
      • Compatibility Matrix
      • Block Explorers
      • Faucet
    • ā‰ļøFAQ
  • Compute Providers
    • šŸ™ƒBasic Info
      • Introduction
      • Gemini Tokenomics (Worker Rewards)
      • Budget balancer
      • Staking Mechanism
      • Requirements in Phala
      • Confidence Level & SGX Function
      • Rent Hardware
      • Error Summary
    • 🦿Run Workers on Phala
      • Solo Worker Deployment
      • PRBv3 Deployment
      • Using PRBv3 UI
      • PRB Worker Deployment
      • Switch Workers from Solo to PRB Mode
      • Headers-cache deployment
      • Archive node deployment
    • šŸ›”ļøGatekeeper
      • Collator
      • Gatekeeper
  • Web Directory
    • Discord
    • GitHub
    • Twitter
    • YouTube
    • Forum
    • Medium
    • Telegram
Powered by GitBook
On this page
  • Best Practices for Environment Variables
  • Configuration Steps

Was this helpful?

Edit on GitHub
  1. Phala Cloud
  2. 🄷Phala Cloud User Guides
  3. Deploy and Manage CVMs

Set Secure Environment Variables

PreviousDeploy CVM with Docker ComposeNextDeploy Private Docker Image to CVM

Last updated 2 months ago

Was this helpful?

LogoLogo

Participate

  • Compute Providers
  • Node
  • Community
  • About Us

Resources

  • Technical Whitepaper
  • Token Economics
  • Docs
  • GitHub

More

  • Testnet
  • Explorer
  • Careers
  • Responsible Disclosure

COPYRIGHT Ā© 2024 PHALA.LTD ALL RIGHTS RESERVED. May Phala be with you!

Best Practices for Environment Variables

When your application requires environment variables, never set them directly in the Docker Compose file. Instead, use the Encrypted Secrets section to ensure your sensitive data remains secure.

Configuration Steps

  1. Declare Environment Variables in Docker Compose

    Define your environment variables in the Docker Compose file using variable substitution:

    services:
      your-service:
        environment:
          - OPENAI_API_KEY=${OPENAI_API_KEY_IN_ENV}
          - TWITTER_API_KEY=${TWITTER_API_KEY_IN_ENV}

    Important: Do not use double quotation marks around variables: āŒ OPENAI_API_KEY="${OPENAI_API_KEY_IN_ENV}"

  2. Set Values in Encrypted Secrets

    Configure the actual values in the Encrypted Secrets section of the Phala Cloud UI.

We recommend using Text type for environment variables if you have many variables to set.

Encrypted Secrets configuration interface
Setting environment variables in Encrypted Secrets