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

feat: added Docker recipe for building + running the homepage #319

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bodom0015
Copy link
Collaborator

@bodom0015 bodom0015 commented Oct 7, 2024

Problem

For consistency in deployment, we could create a Docker image for the project homepage

Approach

  • feat: added a two-stage Dockerfile to build + run the application
    • Stage 1 (build) - uses a NodeJS image to compile app source code
    • Stage 2 (runtime) - copies compiled artifacts into an alpine-based NGINX instance, served on port 80
  • feat: added a Docker Compose file to simplify the commands needed to run the image
    • docker compose up -d --build can be used to build + run the app in one step

How to Test

  1. Checkout and run this branch locally
  2. Build the image: docker compose build
    • NOTE: this is a shorthand for running docker build -t herop/sdoh-homepage .
  3. Run the image: docker compose up -d
    • NOTE: this is a shorthand for running docker run -it -p 8080:80 --name sdoh-homepage herop/sdoh-homepage
  4. Navigate your browser to port 8080 to view the SDOH Homepage
    • This port can be easily mapped/overridden at runtime
  5. Shutdown the container: docker compose down
    • NOTE: this is a shorthand for running docker rm -f sdoh-homepage

Copy link

netlify bot commented Oct 7, 2024

Deploy Preview for cheerful-treacle-913a24 ready!

Name Link
🔨 Latest commit 0b8bd0b
🔍 Latest deploy log https://app.netlify.com/sites/cheerful-treacle-913a24/deploys/67059d4489c3440008db506c
😎 Deploy Preview https://deploy-preview-319--cheerful-treacle-913a24.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.

@bodom0015 bodom0015 changed the title feat: added Docker recipe for building + running Discovery App feat: added Docker recipe for building + running the site Oct 8, 2024
@bodom0015 bodom0015 changed the title feat: added Docker recipe for building + running the site feat: added Docker recipe for building + running the homepage Oct 8, 2024
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.

1 participant