Files
online-energieausweis/Dockerfile
Moritz Utcke d050fcecec Makefile
2025-02-22 10:29:55 +11:00

16 lines
467 B
Docker

FROM postgres:latest
ENV POSTGRES_USER ${POSTGRES_USER}
ENV POSTGRES_PASSWORD ${POSTGRES_PASSWORD}
ENV POSTGRES_DB ${POSTGRES_DB}
COPY ./prisma/migrations/ /docker-entrypoint-initdb.d/
EXPOSE 5432
# Use a loop to copy migration.sql from each folder to the corresponding directory in the build context
RUN for folder in /docker-entrypoint-initdb.d/*; do \
if [ -d "$folder" ]; then \
cp "$folder/migration.sql" "$folder.sql"; \
rm -rf "$folder"; \
fi \
done