Reputation: 21
I am new to Docker. I have an image containing a yii framework. both front and back end are containing yii framework.
here is my docker-compose.yml file:
version: '2'
services:
frontend:
build: ./dockerfile-frontend
container_name: erp2_frontend
links:
- backend
environment:
ENABLE_ENV_FILE: 1
ENABLE_LOCALCONF: 1
API_TOKEN: "4022dfde02359429d905066e557245c760f68f5c"
ports:
- "8080:80"
backend:
build: ./dockerfile-backend
container_name: erp2_backend
environment:
ENABLE_ENV_FILE: 1
Now I want to connect my backend image to the mssql server which is outside the docker network. Now, the server contains the mssql server are connected to the local network of my host container. My host container is ubuntu-linux. How can I connect the backend to the mssql server ? is that possible?
thanks for reply.
Upvotes: 0
Views: 150
Reputation: 2272
I don't see a network configuration in your docker-compose file which means that the default bridge network will be used.
You can go ahead and simply specify the external mssql IP and port and your container would be able to communication with mssql. Although you can't initiate a connection from the outside as you have not exposed and mapped any port in backend
service.
Upvotes: 1