Open MaxLeiter opened 2 years ago
I made a rudimentary compose file...
version: '3.8'
services:
server:
build: ./server
restart: unless-stopped
user: 1000:1000
environment:
- "PORT=3000"
- "JWT_SECRET=change_me!"
client:
build: ./client
restart: unless-stopped
user: 1000:1000
depends_on:
- server
environment:
- "API_URL=http://server:3000"
ports:
- "3748:3001"
...but they still can't talk to each other. From what I can tell, this is because API_URL=http://localhost:3000
in env.local gets baked in on build so setting it as a runtime env variable has no effect.
I just came across this article which may help?
I would try my hand at fixing this particular issue but I'm not familiar with NextJS so it'd probably take me a while 😅
Thanks! I have a few ideas for improving the environment variables right now. Would you mind opening a PR with the docker-compose and I can add my changes that way?
Done! #13
Server and client both have their respective Dockerfiles, which seem to work, but they can't communicate with one another.