

18:31:49.573 UTC LOG: aborting any active transactionsĭb_1 | 18:31:49.574 UTC LOG: background worker "logical replication launcher" (PID 55) exited with exit code 1ĭb_1 | 18:31:49.574 UTC LOG: shutting downĭb_1 | 18:31:49.623 UTC LOG: database system is shut downĭb_1 | PostgreSQL init process complete ready for start up.ĭb_1 | 18:31:49.698 UTC LOG: starting PostgreSQL 13.4 (Debian 13.4-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bitĭb_1 | 18:31:49.698 UTC LOG: listening on IPv4 address "0.0.0.0", port 5432ĭb_1 | 18:31:49.698 UTC LOG: listening on IPv6 address "::", port 5432ĭb_1 | 18:31:49.713 UTC LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"ĭb_1 | 18:31:49.728 UTC LOG: database system was shut down at 18:31:49 UTCĭb_1 | 18:31:49.738 UTC LOG: database system is ready to accept connectionsĪpp_1 | * Serving Flask app 'app.py' (lazy loading)Īpp_1 | WARNING: This is a development server. 18:31:49.450 UTC LOG: starting PostgreSQL 13.4 (Debian 13.4-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bitĭb_1 | 18:31:49.457 UTC LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"ĭb_1 | 18:31:49.475 UTC LOG: database system was shut down at 18:31:49 UTCĭb_1 | 18:31:49.485 UTC LOG: database system is ready to accept connectionsĭb_1 | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*ĭb_1 | 18:31:49.565 UTC LOG: received fast shutdown requestĭb_1 | waiting for server to shut down. You can now start the database server using:ĭb_1 | pg_ctl -D /var/lib/postgresql/data -l logfile startĭb_1 | initdb: warning: enabling "trust" authentication for local connectionsĭb_1 | You can change this by editing pg_hba.conf or using the option -A, orĭb_1 | -auth-local and -auth-host, the next time you run initdb.ĭb_1 | waiting for server to start. okĭb_1 | performing post-bootstrap initialization. Etc/UTCĭb_1 | creating configuration files. 100ĭb_1 | selecting default shared_buffers. posixĭb_1 | selecting default max_connections. okĭb_1 | selecting dynamic shared memory implementation. Here's what that looks like on my terminal: PS C:\Users\itsno\Desktop\samplewebapp> docker-compose upĪttaching to samplewebapp_db_1, samplewebapp_app_1ĭb_1 | The files belonging to this database system will be owned by user "postgres".ĭb_1 | This user must also own the server process.ĭb_1 | The database cluster will be initialized with locale "en_US.utf8".ĭb_1 | The default database encoding has accordingly been set to "UTF8".ĭb_1 | The default text search configuration will be set to "english".ĭb_1 | fixing permissions on existing directory /var/lib/postgresql/data. When I type localhost:5000/ready I get a message that the Postgres connection has failed, and whenever I submit the user details I get an "Internal Server Error". With that said, it still does not connect to Postgres. However, when I go on localhost:5000 I can see my web app normally.

When I run docker-compose up, weirdly, when I follow the host IP that's displayed on my terminal it does not show anything and eventually gives a "took too long to respond" error.

However, once I try to dockerize this application (web app + db) I cannnot get it to work no matter what I try. When I run the app as-is (not inside a Docker container) it works perfectly normal and sends the submitted user info to my local DB successfully. I've written a simple Newsletter web app using Flask that has a connection with my local Postgres database.
