Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable initial dockerized deployment #7

Open
wants to merge 16 commits into
base: master
Choose a base branch
from

Conversation

ChristianUlbrich
Copy link
Member

@ChristianUlbrich ChristianUlbrich commented Jun 12, 2024

This PR dockerizes the old application, while keeping changes to a minimum. It also includes AWS Copilot-enabled deployment, that currently is manually automatically deployed to https://tcq.staging.tcq-reloaded.tcq.ninja/ .

Design Goals

  • minimize changes
  • make it easily runnable on basically any infrastructure
  • enable local development on recent machines
  • zero-conf, i.e. keep amount of configuration both for local development and production minimal
  • remove dependency on any Azure-specific stuff

Non-Design Goals

  • fixing code
  • updating dependencies

In making TCQ run anywhere (just like Java :D), I had to expose internally hard-coded values as environment variables. I tried to make this basically still compatible to the old one, i.e. it still defaults to certain hard-coded stuff like tcq.app, if certain env variables are not set.

Getting rid of Azure-specific stuff, I introduced the concept of adapters, for the DB and the Session Storage, for both in the past CosmosDB has been used. Right now, both can be replaced with non-production-ready memory-based adapters. I'll add mongodb-based ones soonish and I am so far not so happy with the clunky else-if structure.

TODO

  • add MongoDB local service
  • add MongoDB free tier for deployment
  • add MongoDB db adapter
  • add MongoDB session store adapter
  • try some generic import magic to get rid of explicit if-clauses

@ChristianUlbrich
Copy link
Member Author

So it is basically done. Dockerized, ready for deployment on any infrastructure, with either persistency in CosmosDB, MongoDB or in-memory.

What proved to be really challenging - but in a fun way - was the very old environment:

  • NodeJS 10
  • TypeScript 2.8.1
  • node-sass

This is specially challenging for Apple silicon users, because there are no native pre-built NodeJS versions available < 16. So the main idea, was to use docker to have a build environment. node-sass has to be built also from source.

This clearly shows, how far the eco system has progressed and what kind of vendor lock-in you get, by relying on a webpack-based tool chain.

I'll explain some of my rationales in the PR myself.

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.

1 participant