diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3869b85 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM node:16.11.1-bullseye-slim + +ENV USER=mannele + +RUN npm install -g typescript + +RUN groupadd -r ${USER} && \ + useradd --create-home --home /home/mannele -r -g ${USER} ${USER} + +USER ${USER} +WORKDIR /home/mannele + +COPY --chown=${USER}:${USER} . ./ + +RUN npm install && \ + tsc && \ + node dist/deploy-commands.js + +ENTRYPOINT [ "node", "dist/main.js" ] diff --git a/README.md b/README.md index e5eefa1..d99b5d1 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,33 @@ Mannele (Alsacian name for [Stutenkerl](https://en.wikipedia.org/wiki/Stutenkerl A screenshot showing the Bot response to calling the slash command for getting station schedules. The response includes a header with station name with an emoji representing the specific station (for instance the observatory station has a telescope emoji). Then under the header you can find lane stop times. Lanes are grouped by wether they are tramway lanes or bus lanes (once again an emoji is also present with the text to illustrate it). Each lane shows lane arrival times for each direction. Lane arrival times are specified in minutes. When a lane is soon to arrive the text is replaced with 'Now'. +# Docker Configuration + +## Installation +**Linux:** +Install Docker.io +```bash +sudo apt install docker.io +``` + +**macOS:** +You can install Docker desktop [directly from the Docker website](https://www.docker.com/products/docker-desktop) or using `brew cask install docker` +## Usage +Commands to run on Mannele's directory +```bash +docker build . --tag mannele +docker run -d --name mannele mannele +``` +Attention: Before launching the run command, be sure to have set up an .env file at the directory root where will be stored your bot's Discord token, CTS Token and Discord's Server Token. Also add the value below; +```bash +STATS_SLOT_COUNT=1 +``` + +You may run this command to check out if Mannele is correctly running; +```bash +docker logs mannele +``` + ## Contributing Don't hesitate to contribute by opening issues and pull requests to help with bugs and enhancements.