Skip to content
This repository was archived by the owner on Mar 3, 2022. It is now read-only.

Conversation

@radavis
Copy link

@radavis radavis commented Jan 14, 2019

Need to sort out the following error when running docker-compose up...

hubot_1               | { Error: connect ECONNREFUSED 172.18.0.5:3001
hubot_1               |   at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
hubot_1               |
hubot_1               |   errno: 'ECONNREFUSED',
hubot_1               |   code: 'ECONNREFUSED',
hubot_1               |   syscall: 'connect',
hubot_1               |   address: '172.18.0.5',
hubot_1               |   port: 3001 }

Works when skill-search url is localhost:3001 and services launched manually:

$ cd cowbot && yarn start
$ cd skill-search && docker-compose up

@radavis radavis changed the title Add skill-search service Add skill-search service [WIP] Jan 14, 2019
@radavis radavis changed the title Add skill-search service [WIP] Add skill-search service Jan 14, 2019
@radavis
Copy link
Author

radavis commented Jan 14, 2019

Switched port to 3001 within the container, and it works. ¯_(ツ)_/¯

@radavis
Copy link
Author

radavis commented Jan 14, 2019

I think I get it. I don't need to expose port 3001 outside of the container, since all the communication is happening within the docker-compose container(s).

skill-search:
build:
context: ./skill-search
restart: unless-stopped
Copy link
Contributor

Choose a reason for hiding this comment

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

Add an image: block here to tag the image as fearlesstech/cowbot-skill-search:latest, similar to line 22 above.

Copy link
Author

Choose a reason for hiding this comment

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

You will have to point me to some instructions for publishing an image to our docker hub.

* [x] perform etl tasks on a reoccurring basis (weekly/daily/hourly)
* [x] database location specified by environment
* [x] run `yarn run users:refresh` and `yarn run users:refresh` with cron in container
* [ ] steps for creating a database on first-run (in Dockerfile?)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest creating a kick-off script to set as the CMD that will check for a db file, and create one if it doesn't exist

Copy link
Author

Choose a reason for hiding this comment

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

I'm using a volume to link the sqlite database file to a location within the container. From what I understand, we should keep the data and the container separate. I'll probably need some help setting this up the right way.

.skill-search.env
command: "node ./src/jobs/refreshUsers.js"
volumes:
- ./skill-search/data/skill-search.db:/app/data/skill-search.db:rw
Copy link
Author

Choose a reason for hiding this comment

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

TODO: refactor this docker-compose file

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants