Compare commits
8 Commits
master
...
821d60021b
| Author | SHA1 | Date | |
|---|---|---|---|
| 821d60021b | |||
| 1512dd4575 | |||
| b899d44148 | |||
| 3f42b1e393 | |||
| ecc9bef172 | |||
| a9f14411ce | |||
| a4a3176cb0 | |||
| bf152e6d13 |
@@ -7,8 +7,8 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- queues-development
|
- queues-development
|
||||||
- monitoring
|
- monitoring
|
||||||
- mongo-development
|
|
||||||
environment:
|
environment:
|
||||||
|
MONGO_HOST: "mongo.develop.sprinthub.ru"
|
||||||
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
|
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
|
||||||
STAGE: "development"
|
STAGE: "development"
|
||||||
deploy:
|
deploy:
|
||||||
@@ -26,5 +26,3 @@ networks:
|
|||||||
external: true
|
external: true
|
||||||
monitoring:
|
monitoring:
|
||||||
external: true
|
external: true
|
||||||
mongo-development:
|
|
||||||
external: true
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- queues
|
- queues
|
||||||
- monitoring
|
- monitoring
|
||||||
- mongo
|
|
||||||
environment:
|
environment:
|
||||||
|
MONGO_HOST: "mongo.sprinthub.ru"
|
||||||
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
||||||
STAGE: "production"
|
STAGE: "production"
|
||||||
deploy:
|
deploy:
|
||||||
@@ -26,5 +26,3 @@ networks:
|
|||||||
external: true
|
external: true
|
||||||
monitoring:
|
monitoring:
|
||||||
external: true
|
external: true
|
||||||
mongo:
|
|
||||||
external: true
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
var Database mongo.Database
|
var Database mongo.Database
|
||||||
|
|
||||||
func Connect() {
|
func Connect() {
|
||||||
connectionString := fmt.Sprintf("mongodb://mongo:%s@mongo:27017/", utils.GetEnv("MONGO_PASSWORD", "password"))
|
connectionString := fmt.Sprintf("mongodb://mongo:%s@%s:27017/", utils.GetEnv("MONGO_PASSWORD", "password"), utils.GetEnv("MONGO_HOST", "localhost"))
|
||||||
client, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(connectionString))
|
client, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(connectionString))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|||||||
Reference in New Issue
Block a user