I have researched endless sources for an answer, but I simply can’t get this to work. I’ve read about the shortcomings between Docker for WIndows and port-mapping, etc., and unfortunately the workarounds haven’t pointed me at success. I should add that I have little to no background in docker, and that I run Docker Desktop for Windows. Many sources are talking about
docker run commands, but I know little about how to integrate that with the environment Docker Desktop already creates for me via
docker-compose up -d.
What I am trying to do:
- Run my Node.js server locally on localhost:4444 (Windows 10). This provides a graphql playgound.
- The Node server should communicate with a Prisma server. The Prisma server exposes port 4466 from within a Linux container (standard per the docs), and to my Windows machine so that graphql can write modifications to it.
- A MySql database runs in parallel to the Prisma server from inside its own Linux container.
What I’ve tried:
- grab all kinds of IPs from
docker ps, change
network_mode, and some other things.
version: "3.7" services: prisma: image: prismagraphql/prisma:1.34.10 restart: always container_name: prisma_1 ports: - "4466:4466" environment: PRISMA_CONFIG: | port: 4466 managementApiSecret: my-secret databases: default: connector: mysql host: mysql port: 3306 user: root password: prisma rawAccess: true migrations: true mysql: image: mysql:8.0.20 restart: always container_name: db_1 environment: MYSQL_ROOT_PASSWORD: prisma volumes: - mysql:/var/lib/mysql volumes mysql:
Please help me get this to work once and for all. I’ve already spent entirely too many days trying to figure this out.
Where or how do I get the appropriate IP on Windows 10 to connect my local server to the Docker container?
If it’s not an IP issue, what do I need to do to connect the two servers?