version: '3.8'

services:
  frontend:
    build: ./portfolio_frontend
    container_name: portfolio_frontend
    restart: always
    ports:
      - "7200:3000"
    environment:
      - NODE_ENV=production
      - NEXT_PUBLIC_API_URL=http://goopitt.xyz/api
    depends_on:
      - backend
    networks:
      - app_net

  backend:
    build: ./portfolio_backend
    container_name: portfolio_backend
    restart: always
    ports:
      - "7100:3000"
    env_file:
      - .env
    extra_hosts:
      - "host.docker.internal:host-gateway"
    networks:
      - app_net

  redis:
    image: redis:7-alpine
    container_name: portfolio_redis
    restart: always
    volumes:
      - redis_data:/data
    networks:
      - app_net

networks:
  app_net:
    driver: bridge

volumes:
  redis_data:
