version: '3.8'
services:
  gtm-server:  # Tagging server (main)
    image: gcr.io/cloud-tagging-10302018/gtm-cloud-image:stable
    container_name: gtm-server
    ports:
      - "9001:8080"            # Expose container's HTTP port 8080 to host 9001
    environment:
      CONTAINER_CONFIG: "aWQ9R1RNLU5OS002SDNTJmVudj0xJmF1dGg9eThWTExEbFZUbC1GR2tpZV9WRWpSZw=="
      PREVIEW_SERVER_URL: "https://gtm-test.quitsure.app/preview" 
      RUN_AS_HTTPS_SERVER: "false"   # Let Apache handle HTTPS
    volumes:
      - ./data-main:/data      # volume for persistence (cache, logs, etc.)
    restart: unless-stopped
    networks:
      - gtm-network

  gtm-preview:  # Preview server
    image: gcr.io/cloud-tagging-10302018/gtm-cloud-image:stable
    container_name: gtm-preview
    ports:
      - "9002:8080"
    environment:
      CONTAINER_CONFIG: "aWQ9R1RNLU5OS002SDNTJmVudj0xJmF1dGg9eThWTExEbFZUbC1GR2tpZV9WRWpSZw=="
      RUN_AS_PREVIEW_SERVER: "true"   # run this container as Preview server
      RUN_AS_HTTPS_SERVER: "false"
    volumes:
      - ./data-preview:/data
    restart: unless-stopped
    networks:
      - gtm-network

networks:
  gtm-network:
    driver: bridge
