Last active
January 2, 2020 22:24
-
-
Save Jamsek-m/27a5516004e49e81f7dfa953fea8ea9c to your computer and use it in GitHub Desktop.
Docker container database connect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker network create moj-net | |
| docker run -d -p 5432:5432 \ | |
| -e POSTGRES_USER=uporabnik -e POSTGRES_PASSWORD=geslo \ | |
| -e POSTGRES_DB=ime-baze \ | |
| --net moj-net \ | |
| --name baza-container \ | |
| postgres:12 | |
| docker run -d -p 8080:8080 \ | |
| -e KUMULUZEE_DATASOURCES0_CONNECTIONURL=jdbc:postgresql://baza-container:5432/ime-baze \ | |
| -e KUMULUZEE_DATASOURCES0_USERNAME=uporabnik \ | |
| -e KUMULUZEE_DATASOURCES0_PASSWORD=geslo \ | |
| --name service-container \ | |
| -- net moj-net \ | |
| image-name | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-drun detached (in background)-pport mapping (EXTERNAL:INTERNAL)-epass environment variable in form KEY=value--namename of container (name can be used as host and copied to container ip in same network)--netspecify to join network