docker-compose.yml
version: '3'
services:
db:
image: "postgres"
build: .
ports:
- "5432:5432"
env_file:
- database.env
Dockerfile
FROM postgres:9.3
ADD CreateDB.sql /docker-entrypoint-initdb.d/
CreateDB.sql
CREATE TABLE data_actions (
username VARCHAR NOT NULL,
json_payload VARCHAR NOT NULL,
cache_id VARCHAR,
action_timestamp TIMESTAMP
)
database.env
DOCKER_USER=docker
DOCKER_DB=docker
DOCKER_PASSWORD=docker
These are the files I'm using to create this container. I've verified that the CreateDB.sql script is copied into the container and is in the correct location. When I build and run the container and check pgAdmin, there are no tables in the docker database. I feel like I'm missing something obvious here?
UPDATE Here are the logs from startup ->
LOG: database system was interrupted; last known up at 2020-12-23 18:21:18 UTC
LOG: database system was not properly shut down; automatic recovery in progress
LOG: record with zero length at 0/17A7030
LOG: redo is not required
LOG: MultiXact member wraparound protections are now enabled
LOG: autovacuum launcher started
LOG: database system is ready to accept connections
LOG: received smart shutdown request
LOG: autovacuum launcher shutting down