# Start a new stage for PostgreSQL
FROM postgres:16 AS postgres

# Set environment variables for PostgreSQL

ARG POSTGRES_USER
ARG POSTGRES_PASSWORD
ARG POSTGRES_DB

ENV POSTGRES_USER=$POSTGRES_USER
ENV POSTGRES_PASSWORD=$POSTGRES_PASSWORD
ENV POSTGRES_DB=$POSTGRES_DB

# Copy the schema.sql file to the docker-entrypoint-initdb.d directory
COPY ./initial/*.sql /docker-entrypoint-initdb.d/

# Expose the PostgreSQL port
EXPOSE 5432
CMD ["-p", "5432"]