skip to Main Content

Create database on docker startup

I want to create mysql database on docker-compose startup from database.sql script. My database.sql script is on location: src/main/java/com/project_name/resources/db/database.sql. How should I wrote that in my docker-compose.yml file? Right now neither works. volumes: - ./database.sql:/data/application/database.sql or something like: volumes: -…

VIEW QUESTION

Docker doesn't create database

I have Dockerfile: FROM postgres ENV POSTGRES_USER root ENV POSTGRES_PASSWORD root ENV POSTGRES_DB world COPY world.sql /docker-entrypoint-initdb.d/ I run docker build -t postgres, then I create container but it doesn't create database in PG. Does anyone have any idea? world.sql…

VIEW QUESTION
Back To Top
Search