Closed mind-overflow closed 1 year ago
Make sure you've set the env variable "BACKEND_URL" in your front container, it should fix the "nginx: [emerg] no host in upstream ":4000"" error.
This is because in docker-compose the client must depend on the server
version: "3"
services:
server:
build:
context: ./server
volumes:
- ./logs:/home/node/app/logs
environment:
- DATABASE_URL=postgresql://postgres:postgres@db/pckd
- DATABASE_TYPE=postgres
- JWT_SECRET=verysecurestring
- IPREGISTRY_API_KEY=f1ntkcjoqaazglj7
depends_on:
- db
frontend:
build:
context: ./client
ports:
- 80:80
environment:
- BACKEND_URL=http://server:4000
depends_on:
- server
db:
image: postgres:13-alpine
volumes:
- ./db:/var/lib/postgresql/data
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=pckd
Using either the latest docker image or building it myself, I get this error:
Which makes Pckd unreachable from the web.