Suppose we have a sealed container (fixed volume) and we introduce two gases $\ce{A}$ and $\ce{B}$. The two reactants
$$\ce{A + B <=> C}$$
form another gas $\ce{C}$ with equilibrium constant $K$. We know that a closed system at constant $(T,P)$ a system reaches equilibrium where Gibbs free energy $G$ takes its minimum value. Can a reaction reach equilibrium in a closed container (fixed volume)?
Although the system can be coupled to a heat bath (providing the constant temperature condition), by fixing the volume, the necessary condition of constant pressure for $G$ minimization is lost. Can the equilibrium state now be predicted?
I mean if the piston was movable (e.g. coupled to an external pressure of $1$ atm) the system would reach equilibrium and we could find the equilibrium state (e.g. the gas composition) by using the equilibrium constant $K$.
I am asking this question because in many sites I have seen the following Le Chatelier's Principle:
When there is a decrease in volume, the equilibrium will shift to favor the direction that produces fewer moles of gas.
I can't understand why we are free to make such a statement if the pressure is not constant. I am not asking about Le Chatelier's Principle. I just gave that example to justify the motivation behind the question.
Another example is when we want to predict the vapor pressure of a liquid (again sealed container). We put some liquid in the closed container and after a while equilibrium is established where vapor pressure is related to an equilibrium constant $K_ \text{p}$.
In summary I want to understand what let us use equilibrium constants under non-constant pressure conditions.