CSS360 docker environment instructions
From CommunityData
- If you are on Windows or are not comfortable with your computer internals, use the Docker image from the CSS Remote Linux Lab: https://csswiki.uwb.edu/css-linux-lab-docker-image/ -- use the run as administrator options, and use the 'permanent' option when launching docker rather than the 'temporary' one, so you don't lose work
- Once you are in a Linux terminal or equivalent, follow the tutorial at https://discord.com/developers/docs/quick-start/getting-started closely -- with some exceptions:
- ignore the git command in the tutorial and instead fork your group's version of the Discord sample app described in the tutorial. This will mean we all start with the same code even if Discord makes updates, any changes you make will not go to Discord HQ, you are working with the repository associated with your group, and your work will be attributed correctly.
- Remember once you are inside the linux lab computer on docker, you are in Linux -- use the Linux instructions for installing npm and ngrok
- I used the Linux download option for ngrok -- from the terminal, do this:
- curl https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.tgz --output ngrok-v3-stable-linux-amd64.tgz
- In order to run npm and ngrok at the same time, you'll want two windows. Once you have a powershell window running docker running Linux, open a second power shell, and run: docker exec -ti yourUWNetIDLinuxMachine /bin/bash -- replacing yourUWNetID with whatever you named your container (mine is kayleaLinuxMachine)
- You will end up installing ngrok, npm, cloning the GitHub example, and establishing an identity with discord for your bot.
- Tips
- Allow some time for this! If you haven't done docker / linuxlab before, it may take a while just to get the download to finish.
- If you get stuck, walk through the tutorial line by line: it's detailed, and it works, but there are some subtleties.
- I found it helpful to do this phase on a pair of large monitors so that I could have all my windows open side-by-side.
- If you are using docker, you're using Linux. Install linux tools into linux! Not windows tools :)
- Be very careful with the API tokens and secrets: do NOT exchange them via public channels, do NOT commit them into GitHub, and do NOT paste them into AI tools or search engines!
- Step 4 of the tutorial has you edit the sample project's code. If you get a 'didn't respond in time' error when testing your bot, perhaps it is because there's no response to the '/challenge' command in your project code?
- Remember that your team only needs one deployment environment (screenshot that it works).
- Feel free to use AI tools as a tutor or source for debugging any issues that come up.
- You should consider your fork to be a 'hard fork' -- that is, I do not expect (or want...) you to create a pull request merging your group's code into the class's default code. You will be taking a very basic shell and heading in your own independent direction from the starting point I provide.
- There are many ways to get this up and running; ngrok and commandline Linux are the approach in the tutorial. Once you have docker going, you can edit files in whatever tool you like -- you're just doing the deployment in Docker. If you get the sample running a different way (such as with vscode), that's great. That said, I am unlikely to be able to help you troubleshoot the particulars of your computer, especially if you do something different than the tutorials: my daily use machines all run Linux, and I only use Windows and MacOS for gaming and streaming shows. If you have limited familiarity with your operating system, that's all the more reason to use a Docker image from the CSS Remote Linux Lab: https://csswiki.uwb.edu/css-linux-lab-docker-image/
