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

Adding a docker image #3

Open
Mattie112 opened this issue Jan 25, 2022 · 7 comments · Fixed by #12
Open

Adding a docker image #3

Mattie112 opened this issue Jan 25, 2022 · 7 comments · Fixed by #12
Assignees
Labels
enhancement New feature or request

Comments

@Mattie112
Copy link

Hi,

I'd like to run this in a docker image (to allow easy deployment). Would you accept a PR adding this? Then I can look into it?

And just to understand:

RCON is needed on order to send messages from discord -> factorio?
And you use the log file to go from factorion -> discord? Or where is that used for?

@AGuyNamedJens
Copy link
Owner

Hi,

Sure thing, will look into that feature soon.

RCON is indeed used to send messages to the factorio server, and the log file is used to read the chat from the game, since the only other way would be to use a custom scenario, which disables achievements by default which is exactly not how this bot is supposed to work.

@Mattie112
Copy link
Author

Mattie112 commented Jan 26, 2022

Yeah sounds reasonable. I thought chats would also be supplied by RCON but it does not.

Do you have docker experience? A dockerfile like this should work

FROM node:16
WORKDIR /opt/project
COPY index.js /opt/project/index.js
ADD package-lock.json /opt/project/package-lock.json
ADD package.json /opt/project/package.json
RUN cd /opt/project
RUN npm install

# And then move the config.json to this folder
VOLUME /opt/config
# To bind the log fine (that may be generated by an other container)
VOLUME /opt/factorio-log

CMD node .

Or you can skip the config dir if you only use environment variables.

You can build it with docker build -t versiontag . and then try it with docker run --rm -it versiontag

(at least this is how I run it now)

edit:
I'm happy to submit a PR if you want

@AGuyNamedJens
Copy link
Owner

Yeah, for some reason RCON doesn't provide outputs unless you have a custom scenario that makes RCON do it.

I do have docker experience, I run my own Discord bot (not FactorioChatBot) under docker myself.
I will probably move config.json to a .env file in the future as well. But that dockerfile could work.

I'll have to make some time free to start working on the new updates. feel free to make a PR.

@AGuyNamedJens
Copy link
Owner

I've went ahead and added a dockerfile, will test it later as docker is currently not installed on my system.

I'll start doing more changes once I have more time, such as adding it into the wiki.

@Mattie112
Copy link
Author

Thanks! I'll look into it tonight!

@AGuyNamedJens AGuyNamedJens added the enhancement New feature or request label Jan 26, 2022
@Mattie112
Copy link
Author

#7

If you want to test it I have it pushed to my DockerHub: https://hub.docker.com/repository/docker/mattie112/factorio-chat-bot
Currently running great on my Unraid machine :)

@AGuyNamedJens
Copy link
Owner

Sadly Discord is currently having an outage, however besides for my comment on the new config location it looks good to me.

AGuyNamedJens pushed a commit that referenced this issue Jan 27, 2022
Fixed mod update checker result slicing
@AGuyNamedJens AGuyNamedJens linked a pull request Jan 27, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants