I want to use Redis service as a dependency of my PHP/Nginx (Symfony application) application on GitlabCI and it should use the custom port. I already have Postgres added like this (I'll show just pieces of configurations):
variables:
# POSTGRES - Use the values from the .env.test file.
POSTGRES_DB: offers_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: asdfasdf
services:
- name: postgres:10
# "postgresql" is what we use in the .env.test file
alias: postgresql
here all is okay b-z Postgres image has a list of supported env variables and I can use them to configure Postgres connection.
But for Redis, I can't find any good image where I can configure a custom connection data. I only found official Gitlab documentation on how to use Redis service https://docs.gitlab.com/ee/ci/services/redis.html. So I add Redis to services
services:
- redis:latest
And images built successfully, but on my tests, I'm getting the error like
Error connecting to redis. Connection refused
it's because CI connecting to Redis with default port, but I'm using a custom port. Any idea of how I can override connection details of Redis service?