-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
136707c
commit 31f1920
Showing
3 changed files
with
67 additions
and
33 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
package config | ||
|
||
type Config struct { | ||
YandexAPIKey string `env:"YANDEX_APIKEY,default=''"` | ||
YandexEnabled bool `env:"YANDEX_ENABLED,default=false"` | ||
DadataEnabled bool `env:"DADATA_ENABLED,default=false"` | ||
RedisSentinel bool `env:"REDIS_SENTINEL,default=false"` | ||
RedisSentinelName string `env:"REDIS_SENTINEL_NAME,default='mymaster'"` | ||
YandexAPIKey string `env:"YANDEX_APIKEY,default=''"` | ||
YandexEnabled bool `env:"YANDEX_ENABLED,default=false"` | ||
DadataEnabled bool `env:"DADATA_ENABLED,default=false"` | ||
RedisSentinel bool `env:"REDIS_SENTINEL,default=false"` | ||
|
||
// Deprecated: Use RedisSentinelList instead | ||
RedisSentinelHost string `env:"REDIS_SENTINEL_HOST,default='127.0.0.1'"` | ||
// Deprecated: Use RedisSentinelList instead | ||
RedisSentinelPort string `env:"REDIS_SENTINEL_PORT,default=26379"` | ||
RedisHost string `env:"REDIS_HOST,default=127.0.0.1"` | ||
RedisPort string `env:"REDIS_PORT,default=6379"` | ||
RedisAuth string `env:"REDIS_AUTH,default=''"` | ||
RedisDB int `env:"REDIS_DB,default=0"` | ||
AppPort string `env:"APP_PORT,default=8080"` | ||
AppMode string `env:"APP_MODE,default=prod"` | ||
|
||
RedisSentinelName string `env:"REDIS_SENTINEL_NAME,default='mymaster'"` | ||
RedisSentinelList string `env:"REDIS_SENTINEL_LIST"` | ||
|
||
RedisHost string `env:"REDIS_HOST,default=127.0.0.1"` | ||
RedisPort string `env:"REDIS_PORT,default=6379"` | ||
RedisAuth string `env:"REDIS_AUTH,default=''"` | ||
RedisDB int `env:"REDIS_DB,default=0"` | ||
AppPort string `env:"APP_PORT,default=8080"` | ||
AppMode string `env:"APP_MODE,default=prod"` | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,69 @@ | ||
version: '3.8' | ||
version: "3.8" | ||
services: | ||
app: | ||
image: address-suggestion-proxy:local | ||
restart: unless-stopped | ||
ports: | ||
- '8080:8080' | ||
- "8080:8080" | ||
working_dir: /app | ||
entrypoint: ["go", "run", "."] | ||
volumes: | ||
- .:/app | ||
depends_on: | ||
- redis | ||
- redis-sentinel | ||
networks: | ||
- backend | ||
redis: | ||
image: 'bitnami/redis:latest' | ||
image: "bitnami/redis:latest" | ||
restart: always | ||
environment: | ||
- ALLOW_EMPTY_PASSWORD=no | ||
- REDIS_PASSWORD=password | ||
- REDIS_MASTER_PASSWORD=password | ||
- REDIS_REPLICATION_MODE=master | ||
ports: | ||
- '6379:6379' | ||
- "6379:6379" | ||
volumes: | ||
- suggestion-redis:/bitnami/redis/data | ||
networks: | ||
- backend | ||
redis-slave: | ||
image: "bitnami/redis:latest" | ||
restart: always | ||
environment: | ||
- ALLOW_EMPTY_PASSWORD=no | ||
- REDIS_PASSWORD=password | ||
- REDIS_MASTER_HOST=redis | ||
- REDIS_MASTER_PORT_NUMBER=6379 | ||
- REDIS_MASTER_PASSWORD=password | ||
- REDIS_REPLICATION_MODE=slave | ||
ports: | ||
- "6380:6380" | ||
volumes: | ||
- suggestion-redis-replica:/bitnami/redis/data | ||
networks: | ||
- backend | ||
depends_on: | ||
- redis | ||
redis-sentinel: | ||
image: 'bitnami/redis-sentinel:latest' | ||
image: "bitnami/redis-sentinel:latest" | ||
environment: | ||
- REDIS_MASTER_HOST=redis | ||
- REDIS_MASTER_PASSWORD=password | ||
- REDIS_SENTINEL_DOWN_AFTER_MILLISECONDS=1000 | ||
- REDIS_SENTINEL_QUORUM=1 | ||
ports: | ||
- '26379:26379' | ||
- "26379:26379" | ||
depends_on: | ||
- redis | ||
- redis-slave | ||
networks: | ||
- backend | ||
volumes: | ||
suggestion-redis: | ||
driver: local | ||
suggestion-redis-replica: | ||
driver: local | ||
networks: | ||
backend: | ||
driver: bridge | ||
driver: bridge |
This file contains 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