aboutsummaryrefslogtreecommitdiffhomepage
path: root/Dockerfile
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-06-23 02:39:33 +0900
committernsfisis <nsfisis@gmail.com>2025-06-23 02:45:47 +0900
commit6522702f59706c84f419491d4ac8b86cfba2ffe2 (patch)
tree53390ccc269138ae6f1c25c878854cfb257da003 /Dockerfile
parent3a9a4c43c13e881fd62e70dcb698c392b1ed2b64 (diff)
downloadfeedaka-6522702f59706c84f419491d4ac8b86cfba2ffe2.tar.gz
feedaka-6522702f59706c84f419491d4ac8b86cfba2ffe2.tar.zst
feedaka-6522702f59706c84f419491d4ac8b86cfba2ffe2.zip
chore: git-ignore pre-built artifact
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile19
1 files changed, 17 insertions, 2 deletions
diff --git a/Dockerfile b/Dockerfile
index 3161fa0..014ddcb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,16 @@
-FROM golang:1.23-alpine AS builder
+FROM node:22-alpine AS frontend-builder
+
+WORKDIR /app
+
+COPY package.json package-lock.json ./
+RUN npm install
+
+COPY . ./
+RUN npm run build
+
+##########################################
+
+FROM golang:1.23-alpine AS backend-builder
WORKDIR /app
@@ -7,12 +19,15 @@ COPY go.mod go.sum ./
RUN go mod download
COPY . ./
+COPY --from=frontend-builder /app/static/style.css ./static/style.css
RUN CGO_ENABLED=1 GOOS=linux go build -o feedaka main.go
+##########################################
+
FROM alpine
WORKDIR /app
-COPY --from=builder /app/feedaka /app
+COPY --from=backend-builder /app/feedaka /app
EXPOSE 8080
CMD ["/app/feedaka"]