From fb7d5bfb0b780486d3b6191dda7c0a340abe286e Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Fri, 13 Feb 2026 17:03:35 -0800 Subject: feat: add docker support and update readme (NK-kqt9oc) --- Dockerfile | 40 ++++++++++++++++++++++++++++++++++++++++ README.md | 39 +++++++++++++++++++++++++++------------ docker-compose.yaml | 11 +++++++++++ 3 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..89ba3fd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +# Stage 1: Frontend Build +FROM node:20-slim AS frontend-builder +WORKDIR /app/frontend +COPY frontend/package*.json ./ +RUN npm install +COPY frontend/ ./ +RUN npm run build + +# Stage 2: Backend Build +FROM golang:1.23-bullseye AS backend-builder +RUN go install github.com/GeertJohan/go.rice/rice@latest + +WORKDIR /app +COPY go.mod go.sum ./ +RUN go mod download + +COPY . . +# Copy built frontend assets from Stage 1 +COPY --from=frontend-builder /app/frontend/dist ./frontend/dist + +# Embed assets and build the binary +RUN rice -i ./web embed-go +RUN go build -o neko . + +# Stage 3: Final Image +FROM debian:bullseye-slim +WORKDIR /app +COPY --from=backend-builder /app/neko . +COPY --from=backend-builder /app/static ./static + +# Ensure data directory exists +RUN mkdir -p /app/data + +# Default environment variables +ENV NEKO_PORT=8080 +ENV NEKO_DB=/app/data/neko.db + +EXPOSE 8080 + +CMD ["./neko", "-s", "8080", "-d", "/app/data/neko.db"] diff --git a/README.md b/README.md index b7e97e8..d79e3d1 100644 --- a/README.md +++ b/README.md @@ -19,25 +19,26 @@ - [Neko](#neko) - - [Features](#features) - - [Screenshots](#screenshots) + - [Features](#features) + - [Screenshots](#screenshots) - [Installation](#installation) - - [Requirements](#requirements) - - [Building](#building) - - [Dependencies](#dependencies) + - [Requirements](#requirements) + - [Building](#building) + - [Build with React Frontend](#build-with-react-frontend) - [Configuration](#configuration) - - [Storage](#storage) + - [Storage](#storage) - [Usage](#usage) - - [Web Interface](#web-interface) - - [Add Feed](#add-feed) - - [Crawl Feeds](#crawl-feeds) - - [Export](#export) + - [Web Interface](#web-interface) + - [Add Feed](#add-feed) + - [Crawl Feeds](#crawl-feeds) + - [Export](#export) - [All Command Line Options](#all-command-line-options) - [Configuration File](#configuration-file) - [TODO](#todo) - [History](#history) - - [Early 2017](#early-2017) - - [July 2018 -- v0.2](#july-2018----v02) + - [Early 2017](#early-2017) + - [July 2018 -- v0.2](#july-2018----v02) + - [February 2026 -- v.03 -- Vibe-code Modernization](#february-2026----v03----vibe-code-modernization) - [Feedback](#feedback) @@ -78,6 +79,20 @@ Binaries are not yet officially provided, but the project is designed for easy s ## Building +### Docker + +The easiest way to run Neko is using Docker and Docker Compose. + +1. **Build and Start**: + ```bash + docker-compose up -d + ``` + +2. **Access**: + The web interface will be available at `http://localhost:8080`. + +Data is persisted in a Docker volume named `neko-data` (mapping to `/app/data/neko.db` inside the container). + ### Build with React Frontend Neko now includes a modern React frontend. To build the full application: diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..85e6ee3 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,11 @@ +services: + neko: + build: . + ports: + - "8080:8080" + volumes: + - neko-data:/app/data + restart: unless-stopped + +volumes: + neko-data: -- cgit v1.2.3