Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Created December 7, 2022 20:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shelob9/5acf87771a041a6b4f91355e6d1cb6f4 to your computer and use it in GitHub Desktop.
Save Shelob9/5acf87771a041a6b4f91355e6d1cb6f4 to your computer and use it in GitHub Desktop.
Add new environment variable, from .env file, to Laravel sail, in docker-compose file https://laravel.com/docs/9.x/sail
laravel.test:
build:
context: ./vendor/laravel/sail/runtimes/8.1
dockerfile: Dockerfile
args:
WWWGROUP: '${WWWGROUP}'
image: sail-8.1/app
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- '${APP_PORT:-80}:80'
- '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
environment:
# New variable
FLARE_KEY: '${FLARE_KEY}'
WWWUSER: '${WWWUSER}'
LARAVEL_SAIL: 1
# These last two have defaults
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'
volumes:
- '.:/var/www/html'
networks:
- sail
depends_on:
- mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment