aboutsummaryrefslogtreecommitdiffhomepage
path: root/Dockerfile
diff options
context:
space:
mode:
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"]