Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Scaffolding #3

Merged
merged 12 commits into from
Jul 30, 2024
Merged

Docker Scaffolding #3

merged 12 commits into from
Jul 30, 2024

Conversation

falquaddoomi
Copy link
Contributor

@falquaddoomi falquaddoomi commented Jul 20, 2024

This PR adds the following:

  • a Dockerfile for the frontend, so that it can be built as a container and run alongside the rest of the services
  • docker-compose.*.yml files for various environments
  • run_stack.sh, which facilitates building images and running the Docker Compose stack
  • backend folder, Dockerfile, other supporting bits; includes a simple "Hello, world!" plumber API server
  • placeholder folders:
    • cluster: SLURM Dockerfiles, config
    • services/postgres: configuration for the PostgreSQL instance
  • updates to the README.md describing the above
  • a template .env file

I'll be submitting a PR for the backend shortly that implements a more fleshed-out API and other supporting bits for the backend, but I didn't want to complicate this PR with it. I anticipate that we can get this PR approved first, then I'll submit the second backend PR that contains a more concrete skeleton of the API, and get that merged. We can then start integrating the frontend into the backend and iterate on the backend API and schema as needed.

At the moment, this builds and runs the frontend at http://localhost:5713, and the plumber API at http://localhost:9050. You should be able to access both after copying your .env.TEMPLATE as .env and invoking ./run_stack.sh.

…ded some missing dependencies that appeared to be required.
…rs where other services will be implemented. Updates README.
Copy link

netlify bot commented Jul 20, 2024

Deploy Preview for molevolvr ready!

Name Link
🔨 Latest commit 44e23c9
🔍 Latest deploy log https://app.netlify.com/sites/molevolvr/deploys/66a955c10709f1000817a473
😎 Deploy Preview https://deploy-preview-3--molevolvr.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@vincerubinetti
Copy link
Collaborator

vincerubinetti commented Jul 30, 2024

Something that might be useful, since we may have many people on the team running this locally, is to open the webapp automatically when running the stack. Normally this is easy by just running vite --open, but it seems like it'll be more of a pain to do that when running the vite command from docker. Perhaps you could add a simple open localhost:5173 command near the end of run_stack after some timeout or perhaps waiting for some stdout output to indicate that the stack is ready.

One of the benefits of vite --open (other than being very simple) is that it won't open another tab if one is already open.

app/package.json Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
app/Dockerfile Outdated Show resolved Hide resolved
Copy link
Collaborator

@vincerubinetti vincerubinetti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks good to me. Tested it out locally, and frontend, plumbr hello world, and swagger docs seem to work as expected.

Pending my other comments, feel free to merge.

falquaddoomi and others added 2 commits July 30, 2024 10:14
Co-authored-by: Vincent Rubinetti <[email protected]>
Co-authored-by: Vincent Rubinetti <[email protected]>
app/Dockerfile Outdated Show resolved Hide resolved
app/Dockerfile Outdated Show resolved Hide resolved
app/Dockerfile Outdated Show resolved Hide resolved
app/Dockerfile Outdated Show resolved Hide resolved
app/Dockerfile Outdated Show resolved Hide resolved
@falquaddoomi
Copy link
Contributor Author

So, I've added a very work-in-progress production configuration that actually uses the release target from app/Dockerfile. If you want to test it, you can run ./run_stack.sh prod and then open http://localhost to see that it does in fact correctly build and serve the app bundle.

I believe I've addressed your other points, @vincerubinetti, but please let me know if I missed something. Also, thank you very much for the thorough review and commentary!

@falquaddoomi falquaddoomi merged commit 343a62a into main Jul 30, 2024
@falquaddoomi falquaddoomi deleted the docker-scaffolding branch July 30, 2024 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants