Virtual Cards Against Humanity as an Azure Web App

2020 was already an apocalyptic year here in Australia with epic drought and then much of the country on fire. Now with COVID-19 tightening its grip on the world, our socializing has moved online. Video social catchups are great, but during one of our catchups with friends we wondered if it was possible to play virtual Cards Against Humanity. A few searches later found a number of projects that do just that, such as playingcards.io and Pretend You’re Xyzzy. Neither are quite what we were looking for, but I did find a fork of the Pretend You’re Xyzzy with a nicer front end and customizations. This then prompted the question of how could we host this privately for virtual cards against humanity games with our friends during virtual video catchups. The answer is Virtual Cards Against Humanity as an Azure Web App.

Disclaimer: the solution presented here is simply containerization of the archived PYX-Reloaded project by Gianluca Altomani which in turn is a fork of Andy Janata’s Pretend You’re Xyzzy  project which is an online version of Cards Against Humanity

License: Cards Against Humanity is available under a Creative Commons BY-NC-SA 2.0 license. That means you can use, remix, and share the game for free, but you can’t sell it without our permission. Please do not steal our name or we will smash you.

Virtual Cards Against Humanity as an Azure Web App

In order to deploy the PYX-Reloaded project as an Azure Web App I needed to containerize it. I’m no container expert and it took a number of base container images to meet the dependencies and have a working solution. It is more than likely possible to build a Docker Image with a smaller footprint than what I’ve done. Essentially, I went for the least effort but functional approach.

I’ve published the image on Docker Hub here. This means to deploy Virtual Cards Against Humanity as an Azure Web App we simply need to create an Azure Web App, configure it to pull the image and we’re done.

Creating the Cards Against Humanity Azure Web App

From the Azure Portal create a new Web App, that will be published using a Linux Docker Container. I went of the Basic B1 size which is working just fine.

Create new Azure Web App - Configuration Basics

The Docker configuration for the Web App is to pull the image from my repository in Docker Hub;

  • Image and tag: darrenjrobinson/cardsagainsthumanity:latest
  • Startup Command: /bin/bash /root/cah.sh

You could also take my image, change the configuration/preferences, push it to your own Repository and use that as your source.

Create new Azure Web App - Configuration Docker

You can then review and create.

Create new Azure Web App - Configuration Review and Create

Playing Virtual Cards Against Humanity

With your Virtual Cards Against Humanity Azure Web App deployed you can then browse to your Web App URL and setup a game, add additional card packs and invite your friends to have some fun and laughter all whilst respecting social distancing. Enjoy.

New Cards Against Humanity Game Playing 2New Cards Against Humanity Game Playing