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

Add Docker files to support personal deployments #7766

Merged
merged 3 commits into from
Nov 2, 2024

Conversation

xdg
Copy link
Contributor

@xdg xdg commented Sep 24, 2024

This commit adds Dockerfiles to create images to support production deployment of personal jnet servers using Docker Compose.

There are three new Dockerfiles for three images:

  • Dockerfile.cards -- bundles card images with nginx for serving as static files under /img/cards.
  • Dockerfile.initdb -- bundles mongorestore and a dump of the initial database for use populating database independent of the repo.
  • Dockerfile.prod -- builds and bundles an uberjar of the application along with the generated public resources.

An example docker-compose.yml file for using these images may be found at https://gist.github.com/xdg/048d0a15580d71948f4c2c1c02353ae0

Closes #7516

@xdg
Copy link
Contributor Author

xdg commented Sep 24, 2024

I've drafted a guide for how to use the Docker images these files will create: Setting up a personal jinteki.net clone.

@NBKelly
Copy link
Collaborator

NBKelly commented Sep 24, 2024

Does this close #7516?

@xdg
Copy link
Contributor Author

xdg commented Sep 25, 2024

Well, as Larry Wall used to say "TIMTOWTDI". So people might want to deploy to production more like jinteki.net rather than my approach. But this PR and the instructions I wrote should help people achieve the end result of what is desired from #7516.

I think I need to update this PR to either bundle a prod.edn or work out how to load it externally with docker compose and document that. I like the externally configured approach so that end users can modify their jnet config without needing to rebuild the image.

@xdg
Copy link
Contributor Author

xdg commented Sep 27, 2024

I rebased this to v135 (so I can build a new image from there) and modified the docker exec to allow setting an external prod.edn file. I'll update my google docs with instructions.

I think this is now good to go and will address the needs of 7516.

I have deployed 3 private jnets this week. The first followed my instructions from scratch (fixing docs bugs as I went!) so I'm pretty confident this is functional as useful to people. The other two added new sections to an existing docker-compose.yml file after following instructions for initializing a database for each one.

@acollign
Copy link
Contributor

acollign commented Oct 3, 2024

Well, as Larry Wall used to say "TIMTOWTDI". So people might want to deploy to production more like jinteki.net rather than my approach.

Right, the PR #7529, which fixes #7516 as well, is taking a similar yet distinct approach to building and running the stack. The choice is yours regarding which contribution you prefer :-). If that makes sense, we could also pick and choose the best part of both approaches. Happy to contribute.

@xdg
Copy link
Contributor Author

xdg commented Oct 5, 2024

Rebased to v136.1

@NoahTheDuke
Copy link
Collaborator

status?

@xdg
Copy link
Contributor Author

xdg commented Oct 30, 2024

@acollign can we merge this as is? As I said in this comment, I think this PR can be used as a base for your work. I don't think my approach here precludes anything you're trying to do there.

This commit adds Dockerfiles to create images to support production
deployment of personal jnet servers using Docker Compose.

There are three new Dockerfiles for three images:

* Dockerfile.cards -- bundles card images with nginx for serving as
  static files under /img/cards.
* Dockerfile.initdb -- bundles mongorestore and a dump of the initial
  database for use populating database independent of the repo.
* Dockerfile.prod -- builds and bundles an uberjar of the application
  along with the generated public resources.

An example docker-compose.yml file for using these images may be
found at https://gist.github.com/xdg/048d0a15580d71948f4c2c1c02353ae0
@xdg
Copy link
Contributor Author

xdg commented Oct 30, 2024

Rebased to v137

@acollign
Copy link
Contributor

acollign commented Nov 2, 2024

@acollign can we merge this as is? As I said in this comment, I think this PR can be used as a base for your work. I don't think my approach here precludes anything you're trying to do there.

Sure! Please go ahead. Sorry to the delay, I am not able to focus on netrunner these days.

@NoahTheDuke NoahTheDuke merged commit 9b225ae into mtgred:master Nov 2, 2024
3 checks passed
@xdg xdg deleted the docker-personal branch November 4, 2024 02:31
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.

setting up a production instance
4 participants