aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile27
1 files changed, 27 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..ce9b164
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,27 @@
+# stage 1: build frontend
+FROM node:22-alpine AS frontend
+WORKDIR /app/frontend
+COPY frontend/package.json frontend/bun.lockb* ./
+RUN npm install -g bun && bun install
+COPY frontend/ ./
+RUN bun run build
+
+# stage 2: build backend
+FROM golang:1.25-alpine AS backend
+WORKDIR /app
+COPY go.mod go.sum main.go ./
+COPY auth/ ./auth/
+COPY fetchers/ ./fetchers/
+COPY general/ ./general/
+COPY notes/ ./notes/
+COPY --from=frontend /app/frontend/dist ./frontend/dist
+RUN go mod download
+RUN go build -o llostre .
+
+# stage 3: runtime
+FROM alpine:latest
+RUN apk add --no-cache ca-certificates
+WORKDIR /app
+COPY --from=backend /app/llostre .
+EXPOSE 8080
+CMD ["./llostre"]