Giter Site home page Giter Site logo

Comments (4)

jt6point6 avatar jt6point6 commented on August 19, 2024 4

On a Mac I have to do:

docker exec -it containerid /bin/bash
createdb -U postgres conference_app
psql -U postgres -d conference_app

And after that I copied and pasted the content of create_tables.sql and insert_data.sql

from ps-first-spring-boot-app.

NaegelCy avatar NaegelCy commented on August 19, 2024

Hi folks,

I am still struggling with database creation on docker.
I added a bind mount where I stored my .sql files on container creation process : docker create --name postgres-demo -e POSTGRES_PASSWORD=Welcome -p 5432:5432 -v c:/Users/[my user]/postgres:/data postgres:11.5-alpine.

When I run docker exec -ti postgres-demo bash I can get the files in /data using ls -ltr data.
Unfortunately when I run docker exec -ti postgres-demo psql -U postgres and try ! ls -ltr data there is no result. Consequently I am still wondering how to create tables and isert data into them without being able to access those scripts.

Please help me as I want to learn about Spring boot and this is currently impossibe to me due to lack of knowledge I have with Docker.

Thanks,

Cyril

from ps-first-spring-boot-app.

alchemistfrog avatar alchemistfrog commented on August 19, 2024

@jt6point6's solution works for me on linux (Ubuntu 20.04)

from ps-first-spring-boot-app.

dlbunker avatar dlbunker commented on August 19, 2024

@NaegelCy See the instructions added at the bottom of the readme file for loading files into your docker container.

https://github.com/dlbunker/ps-first-spring-boot-app/tree/master/database/postgresql

from ps-first-spring-boot-app.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.