Water vapor in a sealed glass container processed by lyophilization is a main factor for drug metamorphism. The key to knowing whether there is a leakage occurring in the container is how to detect water concentration and pressure in the sealed container quickly and accurately. In the present paper, a strong absorption line of H2O near 1.39 m is carefully selected to avoid the interference of neighboring transitions. A distributed feedback laser semiconductor laser near 1.396 m is employed as the light source with a power of 10 mW and typical linewidth of 2 MHz by combining with tunable diode laser absorption spectroscopy technique, the concentrations and pressures of water vapor in the sealed container are successfully detected under static condition and dynamic condition. In order to isolate the interference absorption from the ambient water vapor in the air, a differential absorption technique is employed in our experiment, which makes our system simpler than routine nitrogen purging based system. During the measurement, the second harmonic signal is utilized for measuring the concentration and pressure, the concentration is retrieved by the peak value while the pressure is calculated by the full width at half maximum. For the measurement of concentration ranging from 0.2% to 12%, the linear correlation coefficient between the real values and the inversed values and the standard deviation ratio are 0.9978 and 4.81%, respectively. For the measurement of pressure, the correlation coefficient and standard deviation ratio are 0.982 and 5.6%, respectively. The minimum detection limits of the concentration and pressure are 400 ppm and 2.5 Torr, respectively. Moreover, in order to test the system for on-line applications in the pharmaceutical industry, measurements are performed in vials which are placed on a rotary stage to simulate the process of the assemble line. In particular, the amplitude of sinuous signal without absorption is used as the reference signal to validate whether the vial is in the optical path. Besides, this amplitude is also utilized to normalize the laser power. The results show that our system can handle about 300 bottles in one minute, which can meet well the requirements for rapid and real-time detections. This system can be applied directly to the medicine bottle on-line detection, and multicomponent detection can also be realized by employing two or more lasers (e.g. H2O, oxygen, etc.). In the future, we plan to build a system for detecting water vapor and oxygen simultaneously, as oxygen is another import indicator for drug metamorphism.