Environment Variables

Although you could define all the environment variables in the Coolify resource definition, for simplicity and clarity I prefer to have them in an .env or, in this case, .env.local file.

With my Docker Compose setup, you need to create an .env.local file on your server in the /var/data folder. (If you want to change its location, adjust your docker-compose.yml accordingly.) See below for a basic .env file:

# .env.local
APP_DEBUG=0
APP_ENV=prod
APP_SECRET=<your-app-secret>
APP_URL=https://<your-site>

# remember to activate "Connect To Predefined Network" in the Advanced section of your resource
DATABASE_URL=<get-this-from-your-coolify-database-resource>

INSTANCE_ID=<instance-id>

JWT_PRIVATE_KEY=<jwt-private-key>
JWT_PUBLIC_KEY=<jwt-public-key>

MAILER_URL=null://null

SHOPWARE_HTTP_CACHE_ENABLED=0

TRUSTED_PROXIES=127.0.0.1/0

SHOPWARE_PACKAGES_TOKEN

However, there is one variable that needs to be set inside Coolify: SHOPWARE_PACKAGES_TOKEN This variable is required as a build variable in the container provided by Shopware. It is the token that authorizes you to the Shopware package repository, also known as account.shopware.com, and can be obtained through your Shopware account.

TRUSTED_PROXIES

As by definition in this setup Shopware runs behind a (traefik) proxy, this setting is important. It tells Symfony/Shopware to accept requests from your local proxy. Should you use Cloudflare you will have to add Cloudflare's IPs to this (for a full list of Cloudflare server ips see here).

Last updated