Skip to content

Add docker file and build action for it - #4

Open
Mih4n wants to merge 7 commits into
SculkCatalystMC:mainfrom
Mih4n:main
Open

Add docker file and build action for it#4
Mih4n wants to merge 7 commits into
SculkCatalystMC:mainfrom
Mih4n:main

Conversation

@Mih4n

@Mih4n Mih4n commented Jul 18, 2026

Copy link
Copy Markdown

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds containerization + CI automation for building/publishing a Docker image, and also introduces runtime changes to improve startup behavior (working directory detection) and stop/shutdown handling.

Changes:

  • Add Docker build/publish assets (Dockerfile, compose, dockerignore) and a GitHub Actions workflow to publish images to GHCR.
  • Add Nix development environment definitions (shell.nix + flake).
  • Update ProxyPass runtime behavior: set working directory at startup, adjust console buffering, improve upstream connection logs, and add stop/signal handling.

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/ProxyPass.hpp Adds stop-related synchronization members and new method declarations (requestStop / setWorkingDirectory).
src/ProxyPass.cpp Implements working directory setup, console buffering, improved upstream logs, and new stop/signal + input handling logic.
src/Main.cpp Calls ProxyPass::setWorkingDirectory() at startup.
shell.nix Adds a Nix shell for building the project.
flake.nix Adds a Nix flake-based dev shell.
flake.lock Locks nixpkgs input for the flake.
Dockerfile Adds a multi-stage Docker build (builder + slim runtime image).
docker-compose.yml Adds a simple compose service for running the proxy container.
.gitignore Ignores the .vscode directory.
.github/workflows/publishDocker.yml Adds workflow to build and publish a Docker image to GHCR.
.dockerignore Adds a build-context ignore list for Docker builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/ProxyPass.cpp
Comment on lines +44 to +51
namespace {
std::atomic<ProxyPass*> gProxyPassInstance{nullptr};

void proxyPassSignalHandler(int /*signum*/) {
if (auto* instance = gProxyPassInstance.load(std::memory_order_acquire)) {
instance->requestStop();
}
}
Comment thread src/ProxyPass.cpp
Comment on lines +697 to +710
std::thread inputThread([this]() {
std::string command{};
while (std::cin >> command) {
if (command == "stop") {
requestStop();
break;
}
getLogger().error(
"Unknown command: {}. Please check that the command exists and that you have permission to use it.",
command
);
}
getLogger().error(
"Unknown command: {}. Please check that the command exists and that you have permission to use it.",
command
);
});
inputThread.detach();
Comment thread src/ProxyPass.cpp
Comment on lines +73 to +82
auto dir = exePath.parent_path();
for (int i = 0; i < 4 && !dir.empty(); ++i) {
if (std::filesystem::exists(dir / "proxy_settings.jsonc")) {
std::filesystem::current_path(dir);
return;
}
dir = dir.parent_path();
}
std::filesystem::current_path(exePath.parent_path());
}
Comment thread .dockerignore
Comment on lines +59 to +62
# Docker
Dockerfile
.dockerignore
docker-compose.yml
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.

2 participants