From 410db29fe6befcde69a32f8a511ec80fa0fa70c1 Mon Sep 17 00:00:00 2001 From: n30nex Date: Mon, 26 Oct 2026 10:41:34 -0400 Subject: [PATCH] chore: remove unused legacy Dockerfiles (#2314) Fixes #2310. Partial follow-up to #1385 (PR-C). Remove unused `Dockerfile.go` and `Dockerfile.node`, which describe retired alternate builds. Current workflows, Makefile, Compose variants and operator scripts already select the canonical `Dockerfile`. Remove the obsolete formatter exclusions and label the old Node-to-Go migration guide historical, linking current deployment instructions. Historical release prose remains untouched. The canonical image, runtime files, dependencies and Compose behavior are unchanged. Validation: audited all 1,501 tracked files; old and new formatter inputs are exactly the same 633 real Go files. Both formatter commands, YAML/shell/workflow-reference checks, existing workflow/routing tests, COPY gate and test inventory pass. All 218 standalone frontend suites pass. The unchanged backend tree passed full server/ingestor suites, and the unchanged app passed 12 browser smoke cases. TDD exemption: behavior-preserving cleanup/refactor plus documentation; no test files modified. `make` and `actionlint` were unavailable locally; equivalent formatter and focused workflow checks ran directly. [CI passed on this head](https://github.com/Kpa-clawbot/CoreScope/actions/runs/40230911566), including canonical container builds and all browser shards. Three independent reviews passed. The published historical guide and its current-deployment links render correctly in Chromium. No settings/customizer changes. --- .github/workflows/deploy.yml | 5 ++- Dockerfile.go | 61 ------------------------------------ Dockerfile.node | 37 ---------------------- Makefile | 2 +- docs/go-migration.md | 8 ++++- 5 files changed, 10 insertions(+), 103 deletions(-) delete mode 100644 Dockerfile.go delete mode 100644 Dockerfile.node diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cdaa8444..761584b3 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -172,9 +172,8 @@ jobs: - name: Enforce gofmt + go vet (issue #1859) run: | set -e - # gofmt: every tracked *.go file except the misnamed Dockerfile.go, - # which is a Dockerfile (FROM ...) that gofmt cannot parse. - unformatted=$(gofmt -l $(git ls-files '*.go' | grep -vi 'Dockerfile.go')) + # gofmt: every tracked *.go file. + unformatted=$(gofmt -l $(git ls-files '*.go')) if [ -n "$unformatted" ]; then echo "::error::gofmt required on these files:" echo "$unformatted" diff --git a/Dockerfile.go b/Dockerfile.go deleted file mode 100644 index ec2725f5..00000000 --- a/Dockerfile.go +++ /dev/null @@ -1,61 +0,0 @@ -FROM golang:1.27-alpine AS builder - -RUN apk add --no-cache build-base - -ARG APP_VERSION=unknown -ARG GIT_COMMIT=unknown -ARG BUILD_TIME=unknown - -# Build server -WORKDIR /build/server -COPY cmd/server/go.mod cmd/server/go.sum ./ -RUN go mod download -COPY cmd/server/ ./ -RUN go build -ldflags "-X main.Version=${APP_VERSION} -X main.Commit=${GIT_COMMIT} -X main.BuildTime=${BUILD_TIME}" -o /corescope-server . - -# Build ingestor -WORKDIR /build/ingestor -COPY cmd/ingestor/go.mod cmd/ingestor/go.sum ./ -RUN go mod download -COPY cmd/ingestor/ ./ -RUN go build -o /corescope-ingestor . - -# Runtime image -FROM alpine:3.20 - -RUN apk add --no-cache mosquitto mosquitto-clients supervisor caddy wget - -WORKDIR /app - -# Go binaries -COPY --from=builder /corescope-server /corescope-ingestor /app/ - -# Frontend assets + config -COPY public/ ./public/ -COPY config.example.json channel-rainbow.json ./ - -# Bake git commit SHA (CI writes .git-commit before build; fallback for non-ldflags usage) -COPY .git-commi[t] ./ -RUN if [ ! -f .git-commit ]; then echo "unknown" > .git-commit; fi - -# Supervisor + Mosquitto + Caddy config -COPY docker/supervisord-go.conf /etc/supervisor/conf.d/supervisord.conf -COPY docker/supervisord-go-no-mosquitto.conf /etc/supervisor/conf.d/supervisord-no-mosquitto.conf -COPY docker/supervisord-go-no-caddy.conf /etc/supervisor/conf.d/supervisord-no-caddy.conf -COPY docker/supervisord-go-no-mosquitto-no-caddy.conf /etc/supervisor/conf.d/supervisord-no-mosquitto-no-caddy.conf -COPY docker/mosquitto.conf /etc/mosquitto/mosquitto.conf -COPY docker/Caddyfile /etc/caddy/Caddyfile - -# Data directory -RUN mkdir -p /app/data /var/lib/mosquitto /data/caddy && \ - chown -R mosquitto:mosquitto /var/lib/mosquitto - -# Entrypoint -COPY docker/entrypoint-go.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -EXPOSE 80 443 1883 - -VOLUME ["/app/data", "/data/caddy"] - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/Dockerfile.node b/Dockerfile.node deleted file mode 100644 index f6244072..00000000 --- a/Dockerfile.node +++ /dev/null @@ -1,37 +0,0 @@ -FROM node:22-alpine - -RUN apk add --no-cache mosquitto mosquitto-clients supervisor caddy - -WORKDIR /app - -# Install Node dependencies -COPY package.json package-lock.json ./ -RUN npm ci --production - -# Copy application -COPY *.js config.example.json channel-rainbow.json ./ -COPY public/ ./public/ - -# Bake git commit SHA (CI writes .git-commit before build; fallback to "unknown") -COPY .git-commi[t] ./ -RUN if [ ! -f .git-commit ]; then echo "unknown" > .git-commit; fi - -# Supervisor + Mosquitto + Caddy config -COPY docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf -COPY docker/mosquitto.conf /etc/mosquitto/mosquitto.conf -COPY docker/Caddyfile /etc/caddy/Caddyfile - -# Create data directory for SQLite + Mosquitto persistence + Caddy certs -RUN mkdir -p /app/data /var/lib/mosquitto /data/caddy && \ - chown -R node:node /app/data && \ - chown -R mosquitto:mosquitto /var/lib/mosquitto - -# Default config: copy example if no config mounted -COPY docker/entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh - -EXPOSE 80 443 1883 - -VOLUME ["/app/data", "/data/caddy"] - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/Makefile b/Makefile index 34f71ccd..345d628f 100644 --- a/Makefile +++ b/Makefile @@ -109,7 +109,7 @@ vet: bash scripts/allmod.sh vet ./... fmt-check: - @unformatted=$$(gofmt -l $$(git ls-files '*.go' | grep -vi 'Dockerfile.go')); \ + @unformatted=$$(gofmt -l $$(git ls-files '*.go')); \ if [ -n "$$unformatted" ]; then echo "gofmt required on:"; echo "$$unformatted"; exit 1; fi; \ echo "gofmt: clean" diff --git a/docs/go-migration.md b/docs/go-migration.md index cf6b439e..90cf991d 100644 --- a/docs/go-migration.md +++ b/docs/go-migration.md @@ -1,4 +1,10 @@ -# Migrating from Node.js to Go Engine +# Migrating from Node.js to Go Engine (Historical) + +> **Historical guide — July 2025.** These instructions describe the retired +> Node.js-to-Go migration, including obsolete build recipes and Node.js rollback. +> `Dockerfile.go` and `Dockerfile.node` have been removed. For current installation +> and upgrades, follow [Deploy CoreScope](../DEPLOY.md); source builds use the +> canonical [`Dockerfile`](../Dockerfile). Guide for existing CoreScope users switching from the Node.js Docker image to the Go version.