Streamline Your Development: Spring Boot with PostgreSQL & pgAdmin in Docker

Поделиться
HTML-код
  • Опубликовано: 27 янв 2025
  • НаукаНаука

Комментарии • 25

  • @ArtJacob
    @ArtJacob Год назад

    Thank you so much! This video cleared up so many things for me! You're a great teacher!

  • @maheshbabu5400
    @maheshbabu5400 Год назад

    Your videos have been really helpful in understanding spring boot.

    • @DanVega
      @DanVega  Год назад

      I appreciate that and I am glad I can help out.

  • @swipped99
    @swipped99 11 месяцев назад

    top quality tutorials!

  • @codecoder005
    @codecoder005 Год назад +3

    Hi Dan, Thanks for one more good video as always 😊. Can you please come with the changes to spring security in spring boot 3.1.1 ? When I upgraded my spring boot version from 3.0.8 to 3.1.1, the security filter chain bean giving me warning. http.csrf() is going to be deprecated and asking to use http.csrf(withDefaults()).
    http.headers(), http.sessionManagement() are also marked for depreciation and asking to go for withDefaults.
    What caused them to be marked for depreciation?

  • @FrancoisLacoursiere
    @FrancoisLacoursiere Год назад

    Awesome video

  • @AlienAndrew51
    @AlienAndrew51 Год назад +1

    Wish spring would do the same for podman. The ability to chose your container engine would be great.

  • @mrowox
    @mrowox Год назад +1

    Nice tutorial. I cant remember the last time I used PGAdmin though. I use the built-in DB tool inside IntelliJ IDEA Ultimate Edition.

    • @_leftii
      @_leftii Год назад +1

      Same here. Super convenient

  • @nidhalnaffati6440
    @nidhalnaffati6440 Год назад

    Great tutorial ❤

  • @xCaleb
    @xCaleb Год назад

    Does Spring have any tools to automate (as much as possible) the process of making a multi-container deployment? For example, if you wanted to build your project into a jar and also run that in a Docker container? That specifically has been giving me issues for about a week now, in particular it seems it can’t talk to the database that’s running as part of my same compose file…?

  • @saucekode9632
    @saucekode9632 28 дней назад

    Thanks!

  • @hayrullahyasar
    @hayrullahyasar Год назад

    I could not start pgAdmin image. pgAdmin desktop already installed in my computer so I thought port 5050 is already occupied. And lastly I changed the port ports 8888:80, than I can connect. Thank you for the video :)

  • @jesper2455
    @jesper2455 Год назад

    Do you need both generate-ddl and ddl-auto properties or is the latter one enough?

  • @mohamedahidesalahdine6285
    @mohamedahidesalahdine6285 Год назад

    Thanks Dan very useful tutorial but please can you make a video on the last repo that you used to auto connect on pgadmin.

    • @DanVega
      @DanVega  Год назад +1

      That’s this one ☝🏻 At the end I talk about that setup

  • @_leftii
    @_leftii Год назад

    High quality, useful video once again Dan! Question: Do you ever utilize the database tool in Intellij? Not as feature rich or pretty as pgAdmin, but super convenient when trying to stay in intellij.

  • @abhishekomprakash4074
    @abhishekomprakash4074 5 месяцев назад

    It is great that it works for you. i mean, you are able to verify that the table and record was indeed created in the db running in container.
    What will happen when you have posgres db installed on your local machine.
    in my case, i can see the ddl sql that the table got created but it gets created in the local postgres (not in the postgres inside the container)
    My compose file looks like: (container starts fine using docker compose up -d)
    services:
    postgres:
    image: postgres:16
    container_name: postgres_con
    ports:
    - "5432:5432"
    environment:
    POSTGRES_USER: postgres
    POSTGRES_PASSWORD: admin
    POSTGRES_DB: postgres
    Rest is defined in application.properties file.
    Why is the table not getting created in the db inside the container?
    spring.application.name=product-service
    #spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
    spring.jpa.generate-ddl=true
    spring.jpa.hibernate.ddl-auto=create-drop
    spring.jpa.hibernate.show-sql=true
    spring.jpa.show-sql=true
    spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
    #spring.datasource.url=jdbc:postgresql://postgres_con:5432/postgres
    spring.datasource.username=postgres
    spring.datasource.password=admin

    • @abhishekomprakash4074
      @abhishekomprakash4074 5 месяцев назад

      UPDATE:
      I tried my entire exercise on laptop without Postgres installed and this time, the table was created in the postgres db running inside docker container.
      I verified by connecting to the postgres instance via
      docker exec -it postgres_con psql -U postgres -d postgres
      \dt
      and select query.
      May be when Postgres is locally installed then the local installation is used by default.
      I wonder if there is a way to skip using the local instance and use the postgres in the docker container?

  • @AndreaDiPietro-u1t
    @AndreaDiPietro-u1t Год назад

    Hi Dan, Thanks for the high-quality content that are you sharing with the community.
    Is Docker Compose Support suitable for leveraging multiple DBs: for example having entities repository for Domain APIs in a DB (Postgres), and spring batch feature's schema in a different DB (MySQL for instance)?
    When placing multiple DBs in my compose.yml file, SpringBoot spawns multiple ConnectionDetails beans but what's the right way to manage them?
    Parameter 1 of method dataSource in org.springframework.boot.autoconfigure.jdbc.DataSourceConfiguration$Hikari required a single bean, but 2 were found:
    - jdbcConnectionDetailsForDemoDb1: defined in unknown location
    - jdbcConnectionDetailsForDemoDbBatch1: defined in unknown location
    A video with multiple DBs created by the Docker Compose integration would be awesome.

  • @robbugh9217
    @robbugh9217 Год назад

    I downloaded the github project and tried running it. I get the following error:
    org.springframework.boot.docker.compose.core.DockerOutputParseException: Failed to parse docker JSON:
    I have docker installed and can manually run docker-compose on the compose.yaml file and the containers start. However, the app fails with the above error.

    • @robbugh9217
      @robbugh9217 Год назад

      OK, I figured out my problem. I had an older version of docker installed on my Linux system that did work with the Spring Boot Docker Compose plugin. I removed the old version of docker and replaced it with the latest Docker-Desktop version and now the project runs without errors.

  • @jopadjr
    @jopadjr Год назад

    50th...Thanks Dan

  • @javisartdesign
    @javisartdesign Год назад

    Great. There is no need to use the IP of the container, just use the service. Think in the scripts run in the pgadmin is using already the service name instead the ip

    • @victorojo
      @victorojo 6 месяцев назад

      yeah, this worked