How to get env vars from docker-compose into the next js application
Unanswered
Blood cockle posted this in #help-forum
Blood cockleOP
Hi everyone.
I am trying to pass env vars from my docker-compose file to my next js api (13.5).
This is my docker-compose file
I am trying to pass env vars from my docker-compose file to my next js api (13.5).
This is my docker-compose file
version: '3.7'
services:
app:
restart: always
build:
context: app/
dockerfile: Dockerfile
ports:
- "12490:80"
environment:
- NEXT_PUBLIC_MY_VAR=http://example.com/api
- MY_VAR=http://example.com/api1 Reply
Blood cockleOP
I can't use a local env file because my env vars need to be in docker-compose file 😓