/** PM2 — production frontend (nginx upstream — usually port 3004 on server) */
module.exports = {
  apps: [
    {
      name: "modstagram-next",
      cwd: __dirname,
      script: "node_modules/next/dist/bin/next",
      args: "start --port 3004 --hostname 0.0.0.0",
      instances: 1,
      exec_mode: "fork",
      autorestart: true,
      max_memory_restart: "800M",
      env: {
        NODE_ENV: "production",
        PORT: "3004",
        HOSTNAME: "0.0.0.0",
        UPSTREAM_API_URL: "https://api.modstagram.com",
        NEXT_PUBLIC_SOCKET_URL: "https://api.modstagram.com",
        NEXT_PUBLIC_IMAGE_BASE_URL: "https://api.modstagram.com/storage",
        NEXT_PUBLIC_BASE_URL: "/api/v1",
        NEXT_PUBLIC_SITE_URL: "https://modstagram.com",
        GOOGLE_CLIENT_ID:
          "91028483292-vba2ktgbvus1p5ce18ir04h1b5c50gnn.apps.googleusercontent.com",
        NEXT_PUBLIC_GOOGLE_CLIENT_ID:
          "91028483292-vba2ktgbvus1p5ce18ir04h1b5c50gnn.apps.googleusercontent.com",
      },
    },
  ],
};
