The film is The Truman Show (1998), directed by Peter Weir.
Jim Carrey plays Truman Burbank, who gradually realizes his entire life is a 24/7 broadcast. Man on the Moon (1999) is a biopic of Andy Kaufman; Carrey plays Kaufman, who performs a reality-TV stunt, but Truman is the definitive "life is a TV show" narrative.