version: '3.1'

services:
  service-authentication:
    build: .
    image: registry.forge.grandlyon.com/web-et-numerique/web-et-numerique-internet/data.grandlyon.com/web-portal/components/services/authentication:${TAG}
    ports:
      - ${AUTHENTICATION_API_BIND_PORT}:3000
    environment:
      # - POST_LOGOUT_REDIRECT_URI: ${POST_LOGOUT_REDIRECT_URI}
      LEGACY_MIDDLEWARE_URL: ${LEGACY_MIDDLEWARE_URL}
      KONG_URL: ${KONG_URL}
      JWT_LIFETIME: ${JWT_LIFETIME} # in seconds
      COOKIE_DOMAIN: ${COOKIE_DOMAIN}
      ACCESS_TOKEN_COOKIE_KEY: ${ACCESS_TOKEN_COOKIE_KEY}
      REDIS_SENTINEL_HOST: ${REDIS_SENTINEL_HOST}
      REDIS_SENTINEL_PORT: ${REDIS_SENTINEL_PORT}
      REDIS_GROUP_NAME: ${REDIS_GROUP_NAME}
      OIDC_CLIENT_ID: ${OIDC_CLIENT_ID}
      OIDC_CLIENT_SECRET: ${OIDC_CLIENT_SECRET}
      OIDC_AUTH_URL: ${OIDC_AUTH_URL}
      OIDC_TOKEN_URL: ${OIDC_TOKEN_URL}
      OIDC_USER_INFO: ${OIDC_USER_INFO}
      REDIRECT_URI: ${REDIRECT_URI}
      USE_STRICT_SSL: "true"
    restart: unless-stopped 
    # depends_on:
    #   - redis
        
  redis:
    ports:
      - 6379:6379
    image: redis:5.0.0-alpine
    command: ["redis-server", "--appendonly", "yes"]
    hostname: redis
    restart: unless-stopped 
