I want deploy a ‘prismagraphql/prisma:1.34’ container using :
- docker-compose version (1.29.2)
- docker 20.10.9
- CentOS 8.4.2105
but when i use ‘host.docker.internal’ on host not working.
So i try to use :
extra_hosts:
- "host.docker.internal:host-gateway"
My project three files :
datamodel.prisma :
type User {
id: ID! @id
name: String!
}
prisma.yml :
endpoint: http://localhost:4477
datamodel: datamodel.prisma
docker-compose.yml :
version: '3'
services:
prisma:
image: prismagraphql/prisma:1.34
restart: always
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "4477:4477"
environment:
PRISMA_CONFIG: |
port: 4477
# uncomment the next line and provide the env var PRISMA_MANAGEMENT_API_SECRET=my-secret to activate cluster security
# managementApiSecret: my-secret
databases:
default:
connector: postgres
host: host.docker.internal
database: postgres
schema: public
user: postgres
password: yrt
rawAccess: true
port: '5432'
migrations: true
I try many incidents to disable firewall add to /etc/hosts … => NOT WORKING
Here i create a GitHub repo : https://github.com/performautodev/local-prisma-1.34-using-docker-compose-1.29.2-docker-20.10.9-on-CentOS-8.4.2105
2
Answers
✔️ Solved :
The answer is to use the output of this command :
OR
and use the line :
so the yml file look like this :
IMPORTANT: my /etc/hosts is as default :
issue refs :
host.docker.internal not working on prismagraphql/prisma:1.34 on docker-compose (1.29.2) docker 20.10.9 CentOS 8.4.2105
https://github.com/docker/compose/issues/8771
https://github.com/moby/moby/issues/42919
https://github.com/prisma/prisma/issues/9677
host.docker.internal
is not supported on Linux. Have a look at this StackOverflow answer on the workaround.