2026-03-05 00:04:26 -06:00
|
|
|
# Overlord Server Dockerfile
|
|
|
|
|
FROM oven/bun:1 AS base
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# Install Go for agent building and other tools
|
|
|
|
|
RUN apt-get update \
|
|
|
|
|
&& apt-get install -y --no-install-recommends \
|
|
|
|
|
openssl \
|
|
|
|
|
curl \
|
|
|
|
|
ca-certificates \
|
|
|
|
|
wget \
|
|
|
|
|
git \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
# Install Go (latest stable version)
|
|
|
|
|
ENV GO_VERSION=1.25.6
|
|
|
|
|
ARG TARGETARCH
|
|
|
|
|
RUN case "${TARGETARCH}" in \
|
|
|
|
|
amd64) GO_ARCH=amd64 ;; \
|
|
|
|
|
arm64) GO_ARCH=arm64 ;; \
|
|
|
|
|
*) echo "Unsupported architecture: ${TARGETARCH}" >&2; exit 1 ;; \
|
|
|
|
|
esac \
|
|
|
|
|
&& wget -q https://go.dev/dl/go${GO_VERSION}.linux-${GO_ARCH}.tar.gz \
|
|
|
|
|
&& tar -C /usr/local -xzf go${GO_VERSION}.linux-${GO_ARCH}.tar.gz \
|
|
|
|
|
&& rm go${GO_VERSION}.linux-${GO_ARCH}.tar.gz
|
|
|
|
|
|
|
|
|
|
ENV PATH="/usr/local/go/bin:${PATH}"
|
|
|
|
|
ENV GOPATH="/go"
|
|
|
|
|
ENV PATH="${GOPATH}/bin:${PATH}"
|
|
|
|
|
|
|
|
|
|
# Install garble for obfuscated agent builds (requires Go 1.25+)
|
|
|
|
|
RUN go install mvdan.cc/garble@latest
|
|
|
|
|
|
2026-03-05 12:50:16 -06:00
|
|
|
# Copy package files and lockfile
|
|
|
|
|
COPY Overlord-Server/package.json Overlord-Server/bun.lock* ./
|
2026-03-05 00:04:26 -06:00
|
|
|
|
|
|
|
|
# Install dependencies
|
|
|
|
|
RUN bun install --frozen-lockfile
|
|
|
|
|
|
|
|
|
|
# Copy source code and client code (needed for builds)
|
|
|
|
|
COPY Overlord-Server/ ./
|
2026-03-05 12:50:16 -06:00
|
|
|
COPY Overlord-Client/ ./Overlord-Client/
|
2026-03-05 00:04:26 -06:00
|
|
|
|
|
|
|
|
# Create necessary directories
|
|
|
|
|
RUN mkdir -p certs public data
|
|
|
|
|
|
2026-03-05 12:50:16 -06:00
|
|
|
# Build production server bundle and ensure Tailwind CSS is present
|
|
|
|
|
RUN bun run build && test -s ./public/assets/tailwind.css
|
|
|
|
|
|
2026-03-05 00:04:26 -06:00
|
|
|
# Expose the default port
|
|
|
|
|
EXPOSE 5173
|
|
|
|
|
|
|
|
|
|
# Set environment variables (can be overridden)
|
|
|
|
|
ENV PORT=5173
|
|
|
|
|
ENV HOST=0.0.0.0
|
|
|
|
|
ENV DATA_DIR=/app/data
|
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
|
|
2026-03-05 12:50:16 -06:00
|
|
|
# Run the production build
|
|
|
|
|
CMD ["bun", "run", "dist/index.js"]
|