r-anime / misato

💬 Mod bot for the /r/anime Discord
MIT License
6 stars 7 forks source link

Dockerize #246

Closed eritbh closed 1 year ago

eritbh commented 1 year ago

Prepares the bot to run in Docker. Converts all our configuration to be handled through environment variables rather than a config file, since Docker plays nicer with that. Adds a Dockerfile for an image which hosts the backend on port 8080, and a workflow to automatically build the image and publish it to the Github container registry so we can pull from there for deployments. See also r-anime/misato-frontend#14.

eritbh commented 1 year ago

Suggested nginx config to adapt to this and the frontend both being in their own containers (this still needs to be tested):

server {
    server_name discord.r-anime.moe;
    listen 80;

    location = /.well-known/security.txt {
        # ...
    }
    location ~ ^(api|auth)/ {
        # use whatever port the backend container's 8080 is mapped to
        proxy_pass http://localhost:8081;
    }
    location / {
        # use whatever port the frontend container's 8080 is mapped to
        proxy_pass http://localhost:8082;
    }
}