Dockerizing an Existing Rails Application

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ม.ค. 2025

ความคิดเห็น • 59

  • @Coderjourney
    @Coderjourney  8 ปีที่แล้ว +9

    What did you think of the tutorial? I thought I might have went a little too fast.

    • @cmendla
      @cmendla 4 ปีที่แล้ว

      I actually bumped the speed to 1.25. If someone things you are going to fast they can go to .75.

  • @armanmirk
    @armanmirk 7 ปีที่แล้ว

    don't know why this video doesn't have more likes but I suspect for most developers this is the video to watch.

    • @Coderjourney
      @Coderjourney  7 ปีที่แล้ว

      +Mirkury wow that is such a compliment! I really appreciate that. Thank you

  • @conradtaylor29
    @conradtaylor29 7 ปีที่แล้ว +1

    Very helpful video and timely as well because I'm looking to Dockerizing an existing app as well.

  • @rameshdoraiswamy3194
    @rameshdoraiswamy3194 7 ปีที่แล้ว

    Pretty informative. Thanks a lot Keith. Looking for more of your great educational videos on Docker Swarm.

    • @Coderjourney
      @Coderjourney  7 ปีที่แล้ว

      +Ramesh Doraiswamy I'm glad you're finding these useful. Not sure when exactly I'll be digging into Docker Swarm. Please Chime in with any topic suggestions you've got by going to coderjourney.com/survey

  • @ThePolaris87
    @ThePolaris87 5 ปีที่แล้ว

    Awesome, just started working with a Rails + Docker project and this was very helpful, thanks!

    • @Coderjourney
      @Coderjourney  5 ปีที่แล้ว +1

      Awesome. I’m glad you’re finding this useful.

  • @manishspuri
    @manishspuri 8 ปีที่แล้ว +7

    awesome very helpful..!

  • @ericzhou3102
    @ericzhou3102 6 ปีที่แล้ว

    why are the 'POSTGRES_USER' and 'POSTGRES_PASSWORD' parameters in dock-compose.yml left blank? I think it will make the db container running without user and password,right?

    • @Coderjourney
      @Coderjourney  6 ปีที่แล้ว +1

      Leaving the value blank tells docker-compose to substitute in the environment values from the machine running the docker-compose command. This lets us set environment variable locally before running the command to change behavior of the started container without needing to change any files.

  • @edisonleon7174
    @edisonleon7174 8 ปีที่แล้ว

    Great tutorial series, Thank you!

    • @Coderjourney
      @Coderjourney  8 ปีที่แล้ว

      +Edison Leon you're welcome, I'm glad you're liking it. I have some Docker courses over at courses.coderjourney.com if you're wanting to dig deeper.

  • @tommoa5225
    @tommoa5225 5 ปีที่แล้ว

    I like it. It was a nice overview that gave me an idea of what to expect when Dockerising a rails app. I am curious though. Would you say this is a prerequisite to building images for deployment on a Kubernetes cluster?
    I have just started learning k8s and came across this video while I attempt to understand the process of app deployments.

    • @Coderjourney
      @Coderjourney  5 ปีที่แล้ว +1

      I’m glad that you liked it. Knowledge of how to build a docker image is definitely something that I would suggest before digging into kubernetes.

  • @Norm7264
    @Norm7264 7 ปีที่แล้ว

    unless I'm misunderstanding (not unlikely!), it looks to me that the postgres data does not persist in the event of the app being taken down and then up. Is that right? If so, it seems as if this would be a requirement for a live app.

    • @Coderjourney
      @Coderjourney  7 ปีที่แล้ว

      +Les Nightingill you’re legitimately the only person who’s ever noticed that typo. The volume mapping should be to /var/lib/postgresql/data instead. Not sure why pgsql came to mind when I recorded this.

  • @batorshikh.baavgaikhuu
    @batorshikh.baavgaikhuu 7 ปีที่แล้ว

    I didn't get any log message after docker-compose run --rm app rake db:migrate. But my schema.rb changed. What do you think? thanks.

    • @batorshikh.baavgaikhuu
      @batorshikh.baavgaikhuu 7 ปีที่แล้ว

      Is there an any configuration or option to print log into terminal?

    • @batorshikh.baavgaikhuu
      @batorshikh.baavgaikhuu 7 ปีที่แล้ว

      And I have a many migration file. It's so strange rake didn't response any log message.

    • @Coderjourney
      @Coderjourney  7 ปีที่แล้ว

      +Bat-Orshikh Baavgaikhuu is you imported your database file then there wouldn’t be any migrations to apply (because the database state would match). In that case there wouldn’t be much of any output.

    • @batorshikh.baavgaikhuu
      @batorshikh.baavgaikhuu 7 ปีที่แล้ว

      Oh, yes. I got it. thank you.

    • @Coderjourney
      @Coderjourney  7 ปีที่แล้ว +1

      +Bat-Orshikh Baavgaikhuu you’re welcome. Glad I could help.

  • @MrUntiendX
    @MrUntiendX 6 ปีที่แล้ว

    Thanks for the tutorial. I have to specify explicitly POSTGRES_USER: 'value' and POSTGRES_PASSWORD: 'value' in docker-compose file? How come for you works without them specified?

    • @Coderjourney
      @Coderjourney  6 ปีที่แล้ว

      If they are exported into your shell’s environment before running the docker-compose commands then they will be passed through if you don’t provide a value in the YAML file.

  • @juanpmarinr
    @juanpmarinr 7 ปีที่แล้ว

    Very helpful tutorial!!
    I'm learning english so I don't understand what is "external: false" for, can you help me please ? Thaks !

    • @Coderjourney
      @Coderjourney  7 ปีที่แล้ว

      +Juan Pablo Marín "external: false" tells docker-compose that it should create and manage the volume because we aren't using a volume that we created manually, outside of docker-compose. I hope that helps.

  • @batorshikh.baavgaikhuu
    @batorshikh.baavgaikhuu 7 ปีที่แล้ว

    Hi again. Should I rebuild image after some code changes?

    • @Coderjourney
      @Coderjourney  7 ปีที่แล้ว +1

      +Bat-Orshikh Baavgaikhuu in development if you aren’t sharing through a volume then you will need to rebuild the image to get code changes to show up. Outside of development you will always need to rebuild when there is a code change. There are a few other issues that can pop up in development: 1) your code might be updating, but the app isn’t reloading it. Check for a line about “listen” in the development config and comment it out if it is there 2) macOS High Sierra seems to have broken some file sharing with virtualbox and I haven’t quite found a way around it.

    • @batorshikh.baavgaikhuu
      @batorshikh.baavgaikhuu 7 ปีที่แล้ว

      Okay, Thank you. I'll try.

    • @batorshikh.baavgaikhuu
      @batorshikh.baavgaikhuu 7 ปีที่แล้ว

      My files updating, but the app isn't reloading that changes. What should I do?

    • @Coderjourney
      @Coderjourney  7 ปีที่แล้ว

      +Bat-Orshikh Baavgaikhuu does your app use the “listen” gem?

    • @batorshikh.baavgaikhuu
      @batorshikh.baavgaikhuu 7 ปีที่แล้ว

      No. I haven't listen gem. Should I use it?

  • @batorshikh.baavgaikhuu
    @batorshikh.baavgaikhuu 7 ปีที่แล้ว

    Should I Install rails before the dockerizing rails app.?

    • @batorshikh.baavgaikhuu
      @batorshikh.baavgaikhuu 7 ปีที่แล้ว

      I'm getting bundle command not found error.

    • @Coderjourney
      @Coderjourney  7 ปีที่แล้ว

      +Bat-Orshikh Baavgaikhuu if you run any commands locally, outside of Docker, then you will need it, but you should be able to set everything up without adding more to your development machine. I might have slipped up and forgot to run a command in my container in the video.

  • @batorshikh.baavgaikhuu
    @batorshikh.baavgaikhuu 7 ปีที่แล้ว

    Hello How can I run my container as production env?.

    • @Coderjourney
      @Coderjourney  7 ปีที่แล้ว

      You can add a “RAILS_ENV: production” entry to the environment list in docker compose (or an env file)

  • @batorshikh.baavgaikhuu
    @batorshikh.baavgaikhuu 7 ปีที่แล้ว

    Hi. My all configurations are done(DB, APP). But My app is running so slow, I'm using docker on mac. I also run my app on real UBUNTU OS and its running fine.

    • @batorshikh.baavgaikhuu
      @batorshikh.baavgaikhuu 7 ปีที่แล้ว

      Do you know about that?

    • @Coderjourney
      @Coderjourney  7 ปีที่แล้ว

      +Bat-Orshikh Baavgaikhuu the file system sharing between Mac and Docker can be really slow. I avoid using Docker for Mac for that reason (though I may have used that for these tutorials). I would try switching to using docker-machine and also brew install docker-machine-nfs to run to configure a faster file system share.

    • @batorshikh.baavgaikhuu
      @batorshikh.baavgaikhuu 7 ปีที่แล้ว

      Should I reconfigure app environment on docker machine ?

    • @Coderjourney
      @Coderjourney  7 ปีที่แล้ว

      +Bat-Orshikh Baavgaikhuu it’s worth a shot. I’ve always found it faster. Docker for Mac worked for some of these tutorials because at the time the projects were small, but I could never get it working well with a large project.

  • @kojie333
    @kojie333 8 ปีที่แล้ว

    github link does not work for me ? :)

    • @Coderjourney
      @Coderjourney  8 ปีที่แล้ว +1

      +Ryan Clemente whoops, the branch was deleted when my pull request was merged. I've changed the link to be to the pull request itself. Sorry about that.

  • @Nicholas108108
    @Nicholas108108 8 ปีที่แล้ว

    Is that a lovely mechanical keyboard I hear in the background?

    • @Coderjourney
      @Coderjourney  8 ปีที่แล้ว +1

      +Nuclear Nic Yeah... that's no longer part of my recording set up though.

  • @LuisSierra42
    @LuisSierra42 7 ปีที่แล้ว +1

    Dat intro

  • @oleingemannk
    @oleingemannk 7 ปีที่แล้ว +4

    Your tutorial is very good, but these things are so complex that you lost me after 4 min ...

    • @Coderjourney
      @Coderjourney  7 ปีที่แล้ว +2

      +Ole Ingemann Kjørmo there are quite a few different things to consider and understand. Once you've containerized a few different applications it becomes second nature.

    • @oleingemannk
      @oleingemannk 7 ปีที่แล้ว +1

      Thanks. Things are starting to make sense. I think it was the specific gems and services for this app that made it a bit confusing at start.

    • @Coderjourney
      @Coderjourney  7 ปีที่แล้ว +2

      +Ole Ingemann Kjørmo Good. This was a bit of an experiment since you normally won't be converting and app that you're unfamiliar with, but I wanted to give a real life example.