Long truck queue is a common problem at big marine container terminals, where the resources and equipment are usually scheduled to serve ships prior to trucks. To reduce truck queues, some container terminals adopt terminal appointment system (TAS) to manage truck arrivals. This paper addresses two implementation scenarios of TAS: static TAS (STAS) and dynamic TAS (DTAS). First, a non-stationary M(t)/E k/c(t) queueing model is used to analyse a terminal gate system, and solved with a new approximation approach. Then, genetic algorithm is applied to optimise the hourly quota of entry appointments in STAS for the derived queueing model. Lastly to relax the assumption of knowing the truckers' preferred arrival pattern in STAS, we propose the concept of DTAS, which is much easier to apply and can assist individual trucker in making appointment by providing real-time estimation of waiting time based on existing appointments. Our analysis reveals DTAS can significantly increase the system flexibility.