Compare commits
28 Commits
821d60021b
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| d136a71f09 | |||
|
|
e94ca96c42 | ||
| 02d5631c4d | |||
| e791890ea5 | |||
| 710a81139c | |||
| 28e83ee592 | |||
| 7f60dc0f59 | |||
| 900cb70f37 | |||
| 740cac21d3 | |||
| 15563aa75d | |||
| 56add999c6 | |||
| d99d766621 | |||
| 261c850077 | |||
| 04c384add9 | |||
| 41590ee88f | |||
| ad1a0aab30 | |||
| 7a3e65d109 | |||
| 71db409b15 | |||
| 153943b3ed | |||
| b17ed7e7a9 | |||
| a564621d80 | |||
| 59869821f3 | |||
| d9dcfc1a3c | |||
| 932c9b609e | |||
| 71e40b932c | |||
| 39829a7348 | |||
| 9d9c11cf11 | |||
| 75a59c3e5c |
@@ -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,3 +26,5 @@ networks:
|
|||||||
external: true
|
external: true
|
||||||
monitoring:
|
monitoring:
|
||||||
external: true
|
external: true
|
||||||
|
mongo-development:
|
||||||
|
external: true
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- queues
|
- queues
|
||||||
- monitoring
|
- monitoring
|
||||||
|
- mongo
|
||||||
environment:
|
environment:
|
||||||
MONGO_HOST: "mongo.sprinthub.ru"
|
MONGO_HOST: "mongo.sprinthub.ru"
|
||||||
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
|
||||||
@@ -26,3 +27,5 @@ 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@%s:27017/", utils.GetEnv("MONGO_PASSWORD", "password"), utils.GetEnv("MONGO_HOST", "localhost"))
|
connectionString := fmt.Sprintf("mongodb://mongo:%s@mongo:27017/", utils.GetEnv("MONGO_PASSWORD", "password"))
|
||||||
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