Skip to content

containerize application#1

Open
maltegrosse wants to merge 4 commits into
juliendiot42:masterfrom
maltegrosse:container
Open

containerize application#1
maltegrosse wants to merge 4 commits into
juliendiot42:masterfrom
maltegrosse:container

Conversation

@maltegrosse
Copy link
Copy Markdown

@maltegrosse maltegrosse commented Sep 28, 2023

first PR to containerize the application

  • added Dockerfile
  • added example docker-compose
  • introduced environment variable to define channels to translate

(untested as no slack token available yet)

@maltegrosse maltegrosse changed the title Containercontainerize application containerize application Sep 28, 2023
Copy link
Copy Markdown
Owner

@juliendiot42 juliendiot42 left a comment

Choose a reason for hiding this comment

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

Thank you very much for this MR, I had some comments.

Comment thread README.md Outdated

Run:

```docker run -it juliendiot42/slack-auto-translate:latest ```
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

-it here is not necessary because there is no need to go into the container.

Comment thread docker-compose.yml
Comment thread index.js Outdated
Comment on lines +18 to +23
}else{
fromToTable = [
{ from: "general", to: "general-autotranslate" },
{ from: "test-auto-translate", to: "test-auto-translate-2" },
{ from: "random", to: "random-autotranslate" },
];
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This should be removed since now the channels are specified as environment variables.

Comment thread Dockerfile Outdated
Comment on lines +6 to +7
# If you are building your code for production
# RUN npm ci --omit=dev
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Yes, the image is for production.

Comment thread .dockerignore Outdated
@@ -0,0 +1,2 @@
node_modules
npm-debug.log No newline at end of file
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The .env file should also be in the .dockerignore. It contains the API's credentials.

You can probably use the .gitignore.

Comment thread README.md Outdated
Comment on lines +96 to +101
```docker run -it juliendiot42/slack-auto-translate:latest ```

Set environment variables:
- BOT_TOKEN: bot token
- SLACK_APP_TOKEN: slack api token
- CHANNEL_LISTS: "from_channel:to_channel,2nd_chan_from:2nd_chan_to"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

The environment variables should be specified to the docker run command.

@maltegrosse
Copy link
Copy Markdown
Author

added the fixes as requested

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.

2 participants