Troubleshooting AnswerHub Docker Startup

For AnswerHub versions 1.8 and 1.9.

If you need to refresh the Docker pieces, use the following command and it will re-pull and rebuild the Docker container:
$ docker-compose build —-pull —-no-cache

To see everything running in docker:
Once the docker container has started up, use the following command to check and ensure all the docker services are up and running. You should see output similar to the text below:
$ docker ps

To completely Nuke your Docker setup and start over:
$ docker-compose rm -v

Looking at logs for a container:
$ docker ps

861
| ~/opt/answerhub/bin @ Jesses-Work-MBP (Jesse) 

$ docker logs --follow a4de34cbd731

If your localhost address gets blocked for some reason, then you can use a different database.url based on the docker version you are using. The database.name property will be host.docker.internal for Docker version v18.3. For other versions of Docker, please refer to Docker’s release notes for the correct local DNS NAME property.

If you still cannot get your local instance of AnswerHub running, you might need to do the following:

  • You may need to check your config.properties file:
    $ cat ../share/conf/config.properties
    • Double check that the ddl.auto.enabled=true.
    • Double check that the database.name=ahub, database.user=test, data.password=test, and database.url=ahub-mysql.
  • You may need to delete your mysql file in share/db/mysql:
    $ rm -rf ../share/db/mysql $ ls -al ../share/db/mysql
    Total should be 0 $ docker-compose up.
  • You may need to navigate to your docker-compose.yml file, search for the AnswerHub container and add the following line to the end of the container:
    depends_on: 
      - mysql
    

Now your AnswerHub container configuration should look like the following:

answerhub:
container_name: answerhub-container
    build: ../docker/answerhub
    volumes:
      - ../share/customizations:/opt/answerhub/teamhub/customizations
      - ../share/conf:/opt/answerhub/teamhub/conf
      - ../share/sites:/opt/answerhub/teamhub/sites
      - ../share/logs:/opt/answerhub/teamhub/logs
    environment:
      - TH_PROFILE
    expose:
      - "8009"
    deploy:
      resources:
        limits:
          memory: 3G
        reservations:
          memory: 2G
    depends_on:
      - mysql

You should be able to go to http://localhost:80 and your site should show up once the docker-compose up finishes processing.