Coder Social home page Coder Social logo

Docker Integration about prestige HOT 6 CLOSED

sharat87 avatar sharat87 commented on May 20, 2024 1
Docker Integration

from prestige.

Comments (6)

sharat87 avatar sharat87 commented on May 20, 2024

Hey! Thanks for reaching out. Yes, this is something I do have on my roadmap 😃.

That sounds like a fine plan. To confirm we're on the same page, what image will you be basing on for the frontend? Is it nginx? Asking because I'm only familiar with nginx so, if it's something else, I'll have some reading up to do.

Go ahead. I'll assign this to you. Let me know if you need any pointers in navigating the codebase.

PS: I'm told by my peers that I'm quite a bit picky when doing code-reviews. Just a heads-up. 😬

from prestige.

MattTennison avatar MattTennison commented on May 20, 2024

For the development image I'd recommend we base off an official NodeJS image, as it looks like you use parcel to hot reload the files and run it -

npx parcel serve src/index.html --dist-dir dist-serve --port 3040

For production, I suppose it depends on you're hosting the app at the moment, is it static files hosted on Netlify? If so, nginx could work, or maybe Docker ought to be just for development purposes?

from prestige.

sharat87 avatar sharat87 commented on May 20, 2024

Ah interesting. I didn't realize we'd have a separate Dockerfile for development. Yeah that would require NodeJS to run Parcel.

For production, you are right. It's just a bunch of static files, built with Parcel, hosted on Netlify. Docker images for prod is actually what intended when I added that line to the Roadmap. So I'd say the development Dockerfiles are optional, but we'd want the production ones.

from prestige.

MattTennison avatar MattTennison commented on May 20, 2024

Hey @sharat87, wanted to let you know I haven't forgotten about this 😄

Taken a look this morning, I've got the frontend working but the backend isn't quite working yet. I've got some ideas on how to get it working.

Can I just check these assumptions are right before I go down any rabbit holes:

  1. The app runs on Heroku, using the release and web processes in the Procfile
  2. The app needs a Postgres DB to run
  3. The app uses Gunicorn

Also what's a good way of checking the API is working? Do you have some sample requests I could use? I can see on your deployment there's a auth check (GET /api/auth/profile), maybe that would be a good one?

from prestige.

sharat87 avatar sharat87 commented on May 20, 2024

Hey @MattTennison, thanks for dropping an update, I was wondering about this myself 😄.

Regarding your assumptions,

  1. Correct. But I'd rather the Dockerfile have nothing to do with the fact that production runs on Heroku today. I'm considering (haven't decided) moving to ECS soon so I'd want the Dockerfile to be self-sufficient.
  2. There is a Postgres database configured for some upcoming features, but it's not used currently. The Dockerfile shouldn't be bothered with this, and in the docker-compose.yml also, let's not add a Postgres just yet. The backend works happily with SQLite just as well today, and that could be the one for dev environments with the docker-compose.yml.
  3. GUnicorn is a production-ready server that I chose based on Heroku's recommendations. I think it's the best choice to be used in Dockerfile as well. But I'll let you explore more if you're so inclined :)

For health check, yeah, let's use the /api/auth/profile only for now, but I'd want a /health endpoint that responds with ok as the response body later on. Not important right now though.

from prestige.

sharat87 avatar sharat87 commented on May 20, 2024

Closing this since a Dockerfile is now part of the project, and it includes frontend, backend as well as docs in it.

from prestige.

Related Issues (12)

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.