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

Question on how to spin up a Docker image for connecting to homebrewery docker image #5

Open
rjbprime opened this issue May 31, 2021 · 2 comments

Comments

@rjbprime
Copy link

Hi all,

How would one set up a docker image to allow for login into a docker image of homebrewery on localhost? I have never created a docker image from scratch, alwas used a prebuilt image, but on the homebrewery subreddit, they mentioned changing a line of code in one of the homebrewery scripts to connect to a locally hosted and running naturalcrit project.

Kind regards

@earlng
Copy link

earlng commented Jun 4, 2021

I was looking around and trying to figure out the same as you rjbprime. After some digging and poking around in the homebrewery gitter chat, I figured it out.

I created a PR (#6) for some changes that I think would help. So if you are hoping to host via docker, you will be creating a total of 3 containers:

  1. Homebrewery
  2. NaturalCrit
  3. MongoDB

Here is a docker-compose.yml that worked for me:

version: '2'
services:
  mongodb:
    image: mongo:latest
    volumes:
      - mongodb:/data/db
    networks:
      - homebrewery
  homebrewery:
    build:
      context: ./homebrewery
      dockerfile: Dockerfile
    image: homebrewery
    environment:
      MONGODB_URI: mongodb://mongodb/homebrewery
    ports:
      - "8000:8000"
    depends_on:
      - "mongodb"
    networks:
      - homebrewery
  naturalcrit:
    build:
      context: ./naturalcrit
      dockerfile: Dockerfile
    image: naturalcrit
    environment:
      MONGODB_URI: mongodb://mongodb/naturalcrit
    ports:
      - "8010:8010"
    depends_on:
      - "mongodb"
    networks:
      - homebrewery
networks:
    homebrewery:
        driver: bridge

One thing to note on this docker-compose. This docker-compose is in the same directory as the naturalcrit and homebrewery repositories. (that's why the docker-compose context is ./homebrewery and ./naturalcrit respectively).

Another thing to keep in mind is that my PR, notes, and experience is mostly on getting a live, publicly accessible, version of homeberwery (which you can find here). So I am not sure how it all works on just keeping everything on your local network.

Also, make sure to create a docker.json in the /config directory (as specified in the PR!). Let me know if you have any questions.

@earlng
Copy link

earlng commented Jun 4, 2021

Oh! One other thing. The URLs (i.e. https://naturalcrit.com and https://homebrewery.naturalcrit.com) are hard-coded into a few files in both repos. So you will need to change those URLs as well! A "Find in Folder" for those URLs using your local text editor should help you catch all of them.

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

No branches or pull requests

2 participants