Restructured
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
# Stage 1: Build static content (Node.js not needed, just copy HTML)
|
||||
FROM alpine:3.18 AS static-builder
|
||||
WORKDIR /build
|
||||
COPY index.html .
|
||||
COPY static/index.html .
|
||||
RUN mkdir -p /build/static && cp index.html /build/static/
|
||||
|
||||
# Stage 2: Build Go backend
|
||||
@ -9,11 +9,9 @@ FROM golang:1.21-alpine AS go-builder
|
||||
WORKDIR /app
|
||||
|
||||
# Copy go.mod and go.sum if they exist, otherwise they'll be created
|
||||
COPY go.mod go.sum* ./
|
||||
RUN go mod download || true
|
||||
|
||||
# Copy the Go source code
|
||||
COPY main.go .
|
||||
COPY backend/. .
|
||||
RUN go mod download || true
|
||||
|
||||
# Build the Go binary
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o stock-analyzer .
|
||||
|
||||
Reference in New Issue
Block a user