Skip to content

Environment Variables

FTo ensure correct communication between the frontend and backend (especially within the Docker network), you must configure the .env file in the root directory of your starter kit.

Create a .env file and add the following keys:

Terminal window
# Internal API address for Server-Side Rendering (SSR) - Docker service name
INTERNAL_API_URL=http://pyxis-admin:8000
# Public API address accessible by the browser (Client-side)
PUBLIC_API_URL=http://localhost:8000
# Laravel App Key (required for preview signature verification)
LARAVEL_APP_KEY=base64:your-laravel-app-key...
# Secure cache revalidation token (must match Laravel's token)
REVALIDATE_TOKEN=your-secret-revalidate-token
ZmiennaPrzykładowa WartośćOpis
INTERNAL_API_URLhttp://pyxis-admin:8000Used by the server (Node/Astro) for data fetching via the Docker network.
PUBLIC_API_URLhttp://localhost:8000Used when the request is sent directly from the user’s browser.
LARAVEL_APP_KEYbase64:...The backend APP_KEY. Essential for decrypting preview tokens.
REVALIDATE_TOKENsecret123A shared key between backend and frontend to authorize cache clearing.

⚠️ IMPORTANT: Why pyxis-admin? Inside Docker, containers do not recognize each other as localhost. You must use the service name defined in docker-compose.yml.