FROM postgres:14ENV POSTGRES_USER postgresENV POSTGRES_PASSWORD postgresENV POSTGRES_DB postgresEXPOSE 15432
docker-composeversion: "3"services: postgres: build: context: ./docker_files/postgres/ dockerfile: Dockerfile container_name: postgres ports: - "15432:5432"
custom demo Dockerfile
FROM postgres:14ENV POSTGRES_USER kb_db_userENV POSTGRES_PASSWORD JX98#5%wsT^iENV POSTGRES_DB postgresCOPY ./init_files/init-user-db.sh /docker-entrypoint-initdb.d/ADD ./init_files/release.sql.gz /docker-entrypoint-initdb.d/EXPOSE 15432
init-user-db.sh#!/bin/bashset -epsql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL CREATE DATAbase karbon_card_v1;EOSQL
docker-composeversion: "3"services: postgres: build: context: ./docker_files/postgres/ dockerfile: Dockerfile container_name: postgres ports: - "15432:5432"