Comments (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.
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.
@jt6point6's solution works for me on linux (Ubuntu 20.04)
from ps-first-spring-boot-app.
@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)
- Stopping docker container README command typo HOT 1
- FATAL: password authentication failed for user "postgres"
- Readme needs a note about needing to copy *.sql files to local HOT 1
- Bump postgres:11.5-alpine to postgres:11.10-alpine HOT 1
- Postgres Course Setup Steps are Unclear HOT 8
- Readme - Docker create command HOT 1
- Update readme with run from docker HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ps-first-spring-boot-app.