Docker Compose: nitter failed to connect to redis
So, I am setting up Nitter on my VPS via docker-compose. However, it was unsuccessful. And the error message from the nitter container says it failed to connect to Redis. There is another container that uses Redis too, but I think this is not an issue. I tried stopping that container and ran again, but nitter was still not set up. 
Hope I can get help here. Thanks in advance!

## docker-compose logs

The `docker-compose logs nitter` command shows the following message:
```
Attaching to nitter
nitter          | Starting Nitter at http://nitter.my.domain
nitter          | Failed to connect to Redis.
```
for `docker-compose logs nitter-redis` is:
```
nitter-redis    | 1:signal-handler (1689436687) Received SIGTERM scheduling shutdown...
nitter-redis    | 1:M 15 Jul 2023 15:58:07.775 # User requested shutdown...
nitter-redis    | 1:M 15 Jul 2023 15:58:07.777 # Redis is now ready to exit, bye bye...
nitter-redis    | 1:C 15 Jul 2023 15:58:08.332 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
nitter-redis    | 1:C 15 Jul 2023 15:58:08.332 # Redis version=6.2.13, bits=64, commit=00000000, modified=0, pid=1, just started
nitter-redis    | 1:C 15 Jul 2023 15:58:08.332 # Configuration loaded
nitter-redis    | 1:M 15 Jul 2023 15:58:08.334 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
nitter-redis    | 1:M 15 Jul 2023 15:58:08.338 # Server initialized
nitter-redis    | 1:M 15 Jul 2023 15:58:08.338 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
nitter-redis    | 1:M 15 Jul 2023 15:58:08.338 # Done loading RDB, keys loaded: 0, keys expired: 0.
```
I followed the instruction on [the issue mentioned](https://github.com/jemalloc/jemalloc/issues/1328) above but the warning persist.

### docker ps
`docker ps` command shows that `nitter-redis` is healthy:
```
CONTAINER ID   IMAGE            COMMAND                  CREATED        STATUS                    PORTS                                       NAMES
79169a7c673e   redis:6-alpine   "docker-entrypoint.s…"   19 hours ago   Up 36 minutes (healthy)   6379/tcp                                    nitter-redis
bcbf87edcb0e   diygod/rsshub    "dumb-init -- npm ru…"   28 hours ago   Up 49 minutes             0.0.0.0:1200->1200/tcp, :::1200->1200/tcp   rsshub
```

## nitter.conf
Here is my `nitter.conf` file:
```
[Server]
hostname = "nitter.my.domain"  # for generating links, change this to your own domain/ip
title = "nitter"
address = "0.0.0.0"
port = 8080
https = false  # disable to enable cookies when not using https
httpMaxConnections = 100
staticDir = "./public"

[Cache]
listMinutes = 240  # how long to cache list info (not the tweets, so keep it high)
rssMinutes = 10  # how long to cache rss queries
redisHost = "nitter-redis"  # Change to "nitter-redis" if using docker-compose
redisPort = 6379
redisPassword = ""
redisConnections = 20  # minimum open connections in pool
redisMaxConnections = 30
# new connections are opened when none are available, but if the pool size
# goes above this, they're closed when released. don't worry about this unless
# you receive tons of requests per second

[Config]
hmacKey = "secretkeytest"  # random key for cryptographic signing of video urls
base64Media = false  # use base64 encoding for proxied media urls
enableRSS = true  # set this to false to disable RSS feeds
enableDebug = false  # enable request logs and debug endpoints (/.tokens)
proxy = ""   # nitter-redishttps url, SOCKS proxies are not supported
proxyAuth = ""
tokenCount = 10
# minimum amount of usable tokens. tokens are used to authorize API requests,
# but they expire after ~1 hour, and have a limit of 500 requests per endpoint.
# the limits reset every 15 minutes, and the pool is filled up so there's
# always at least `tokenCount` usable tokens. only increase this if you receive
# major bursts all the time and don't have a rate limiting setup via e.g. nginx

# Change default preferences here, see src/prefs_impl.nim for a complete list
[Preferences]
theme = "Nitter"
replaceTwitter = "nitter.net"
replaceYouTube = "piped.video"
replaceReddit = "teddit.net"
proxyVideos = true
hlsPlayback = false
infiniteScroll = false
```
## docker-compose.yml

Here is the `docker-compose.yml`file: 
```yml
version: "3"

services:

  nitter:
    image: zedeus/nitter:latest
    container_name: nitter
    ports:
            - "127.0.0.1:8081:8080" # Replace with "8080:8080" if you don't use a reverse proxy
    volumes:
      - ./nitter.conf:/src/nitter.conf:Z,ro
    depends_on:
      - nitter-redis
        # restart: unless-stopped
        #healthcheck:
        #test: wget -nv --tries=1 --spider http://127.0.0.1:8082/Jack/status/20 || exit 1
        #interval: 30s
        #timeout: 5s
        #retries: 2
    user: "998:998"
    read_only: true
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL

  nitter-redis:
    image: redis:6-alpine
    container_name: nitter-redis
    command: redis-server --save 60 1 --loglevel warning
    volumes:
      - nitter-redis:/data
    restart: unless-stopped
    healthcheck:
      test: redis-cli ping
      interval: 30s
      timeout: 5s
      retries: 2
    user: "999:1000"
    read_only: true
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL

volumes:
  nitter-redis:

```

The website shows `502 Bad Gateway` error message. Here is the nginx conf file:
```
server {
    server_name nitter.my.domain;
    listen 80;
    index index.html index.htm index.php default.html default.htm default.php;

    location / { 
        proxy_pass http://127.0.0.1:8081;
	proxy_http_version 1.1;
    }   
}
```