aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
authorAdam Mathes <adam@adammathes.com>2026-02-13 17:03:35 -0800
committerAdam Mathes <adam@adammathes.com>2026-02-13 17:03:35 -0800
commitfb7d5bfb0b780486d3b6191dda7c0a340abe286e (patch)
tree8b81f60f0bf7c97fa96f85816f9abd89fc82d15d /Dockerfile
parentddcbfc92b9c7b1c932c4bdcadf393b95aa0adc0c (diff)
downloadneko-fb7d5bfb0b780486d3b6191dda7c0a340abe286e.tar.gz
neko-fb7d5bfb0b780486d3b6191dda7c0a340abe286e.tar.bz2
neko-fb7d5bfb0b780486d3b6191dda7c0a340abe286e.zip
feat: add docker support and update readme (NK-kqt9oc)
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile40
1 files changed, 40 insertions, 0 deletions
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"]