version: "3.9"

services:
  gateway-redis:
    image: "redis:6"
    container_name: gateway-redis
    volumes:
      - "${SEPAL_DATA_DIR}/gateway-redis:/data"
    networks:
      - sepal

  gateway:
    build:
      context: ../..
      dockerfile: ./modules/gateway/Dockerfile
    image: "${DOCKER_REGISTRY_HOST:-localhost}/openforis/gateway:${SEPAL_VERSION:-latest}"
    container_name: gateway
    init: true
    environment:
      DEPLOY_ENVIRONMENT: "${DEPLOY_ENVIRONMENT}"
      SEPAL_HOST: "${SEPAL_HOST}"
    networks:
      - sepal
    ulimits:
      nproc: 65535
      nofile:
        soft: 65536
        hard: 65536
    sysctls:
      net.ipv4.tcp_keepalive_time: 60
      net.ipv4.tcp_keepalive_intvl: 60
      net.ipv4.tcp_keepalive_probes: 6
    healthcheck:
      # test: netstat -nl | grep -e ':8001\s'
      timeout: 60s
      interval: 1s
      retries: 60

networks:
  sepal:
    external: true
    name: sepal

version: "3.9"

services:
  gateway-redis:
    image: "redis:6"
    container_name: gateway-redis
    volumes:
      - "${SEPAL_DATA_DIR}/gateway-redis:/data"
    networks:
      - sepal

  gateway:
    build:
      context: ../..
      dockerfile: ./modules/gateway/Dockerfile
    image: "${DOCKER_REGISTRY_HOST:-localhost}/openforis/gateway:${SEPAL_VERSION:-latest}"
    container_name: gateway
    init: true
    environment:
      DEPLOY_ENVIRONMENT: "${DEPLOY_ENVIRONMENT}"
      SEPAL_HOST: "${SEPAL_HOST}"
    networks:
      - sepal
    ulimits:
      nproc: 65535
      nofile:
        soft: 65536
        hard: 65536
    sysctls:
      net.ipv4.tcp_keepalive_time: 60
      net.ipv4.tcp_keepalive_intvl: 60
      net.ipv4.tcp_keepalive_probes: 6
    healthcheck:
      test: netstat -nl | grep -e ':8001\s'
      timeout: 60s
      interval: 1s
      retries: 60

networks:
  sepal:
    external: true
    name: sepal

Revert "Passed DEPLOY_ENVIRONMENT to sepal-server."
Revert "Passed DEPLOY_ENVIRONMENT to sepal-server."

This reverts commit 0b8bd2784cb867c541b179e96bed8a0a9fbd63b5.
