![]() ![]() ![]() In my init SQL there is only 1 line: CREATE DATABASE "MyDataBase" Īs I list DB is Postgres container my DB is nowhere to be found. expect('Failed to create Postgres connection pool. init.sql:/docker-entrypoint-initdb.d/init.sqlĪnd when I start docker-compose up in log I can see db_1 | PostgreSQL Database directory appears to contain a database Skipping initializationÄb_1 | 11:14:36.259 UTC LOG: starting PostgreSQL 12.1 (Debian 12.1-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bitÄb_1 | 11:14:36.259 UTC LOG: listening on IPv4 address "0.0.0.0", port 5432Äb_1 | 11:14:36.260 UTC LOG: listening on IPv6 address "::", port 5432Äb_1 | 11:14:36.264 UTC LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"Äb_1 | 11:14:36.277 UTC LOG: database system was shut down at 11:10:57 UTCÄb_1 | 11:14:36.280 UTC LOG: database system is ready to accept connections We can now re-build the Docker image and run it again: you should immediately see a couple of log. So my docker-compose looks like: version: '3' ![]() postgres docker instance is able to create the files and database on a. Problem is that does not create DB as I ask it nicely. To designate a directory that will be used to keep the database content on my. This file is called docker-compose. Having a ready to use database instance that every programmer can quickly run on their machine can save a lot of time. I am pretty new to docker, so what I am trying to do is create a docker-compose file that on compose command will also create the database. If you use the standard postgres image with no specific config the user is postgres : The name of the DB. Create the Docker Compose file The first step consists of creating the configuration file to run Postgres in Docker.![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |