Open doquocang opened 4 months ago
learning: about port in docker ls
Come up with the idea: how to map Containers inside the same Compose (local) to outside of the Compose For example: map container app-1 (inside compose test) to azuresql (outside compose test):
solution: using port
new Ticket:
map Front end Container and Back end Container
Comprehend:
test-app-1 and test-sql-1 is in the same local network created by Docker, they have the save Gateway
Research about:
Understand:
-Port that container will listen:
Understand:
Learning the basic of docker network
Learning the basic of docker flags (-e, -d, -p, ...)
Learn and create bridge network:
checking network just created:
inspecting network:
Create a sql server 2019 container:
check container:
Import data Get access to root while running container and install
Adding mssql-tools into environment path:
Mount Script folder to Container:
Check mount:
Import database:
Result:
SQL import error:
Connect database to External network:
Check network:
or:
Adjust spring.datasource.url (host name from localhost:1433 to enclave-sql2019:1433) application.properties in server:
Build a new server image:
create docker compose with external bridge docker network created before:
Run docker compose:
Install ping to check the connection between server and the database:
Install:
Check the connection from server to database:
Done with fixing the database, turned out the error was about Visual studio limit code line:
testing the api and database
done: with building back-end image